Escolar Documentos
Profissional Documentos
Cultura Documentos
int n = -100;
unsigned int i = -100;
signed int = 2.9;
long m = 2, p = 4;
int 2k;
double x = 2 * m;
float y = y * 2;
unsigned double z = 0.0;
double d = 0.67F;
float f = 0.52L;
signed char = -1786;
char c = '$' + 2;
sign char h = '\111';
char *name = "Peter Pan";
unsigned char *num = "276811";
int a, b ;
a = -3 - - 3 ;
b = -3 - - ( - 3 ) ;
cout<< a<< b ;
What is the final value of x when the code int x; for(x=0; x<10; x++) {} is run?
A. 10
B. 9
C. 0
D. 1
void main()
{
int i;
for(i=1;i<4,i++)
switch(i)
case 1: printf("%d",i);break;
{
case 2:printf("%d",i);break;
case 3:printf("%d",i);break;
}
switch(i) case 4:printf("%d",i);
}
Ans: 1,2,3,4
Single line comments explaining code would be preceded like in the following
example
/** // *// /*
What punctuation must each command line have at the end of the line?
:
,
!
;
Cout can print multiple values or variables in a single command using the following
syntax:
cout << "Hi" + bob + "\n";
cout << "Hi" << bob << "\n";
cout << "Hi", bob, "\n";
cout << ("Hi" & bob & "\n");
0123456789
0 2 4 6 8 10 12 14 16 18
1010101010
0
switch(x)
}
A. One
B. Zero
C. Hello World
D. ZeroHello World