C Language - Keywords

You Are Here :: Home > C Language > Keywords - General Questions

 
31.

What would be the output of the following program?

#include
main()
{
char str[]="S\065AB";
printf("\n%d", sizeof(str));
}

A. 7 B. 6
C. 5 D. error




32.

What will be output if you will compile and execute the following c code?

#include
int main()
{
int a=5;
float b;
printf("%d",sizeof(++a+b));
printf(" %d",a);
return 0;
}

A. 26 B. 46
C. 25 D. 45




33.

What will be output if you will compile and execute the following c code?

#include
int main()
{
char c='0';
printf("%d %d",sizeof(c),sizeof('0'));
return 0;
}

A. 1 1 B. 2 2
C. 1 2 D. 2 1




34.

What will be output when you will execute following c code?

#include
int main()
{
double num=5.2;
int var=5;
printf("%d\t",sizeof(!num));
printf("%d\t",sizeof(var=15/2));
printf("%d",var);
return 0;
}
Choose all that apply:

A. 4 2 7 B. 2 2 5
C. 2 4 7 D. 8 2 7




35.

How are real floating-type numbers treated in C?

#include
main()
{
printf("%d",sizeof(7.0));
}
A. 7 B. 8
C. 7.0 D. 6




36.

What will be output?

void main()
{
const int a=5;
a++;
printf("%d",a);
}

A. 5 B. 7
C. No error D. Compiler error




« previous

1

2

3

4

5

6

 
 



© 2013 freshersindia.in ® | Copyrights | Terms & Conditions
   Designed by Freshers India
Catch Us on