C Language - Data Types

You Are Here :: Home > C Language > Data Types - General Questions

 
43.

Consider the following program fragment:

int b = 1;
int fiddle(int c)
{
c *= 2; b = 0;
return 3;
}
main()
{ int a = 5, b = 7, c = 2;
c = fiddle(a);
/* HERE */
}
What are the values of a, b and c when execution reaches /* HERE */?

A. a is 5, b is 1, c is 4 B. a is 10, b is 7, c is 2
C. a is 10, b is 1, c is 3 D.




44.

.If the binary eauivalent of 5.375 in normalised form is 0100 0000 1010 1100 0000 0000 0000 0000, what will be the output of the program (on intel machine)?

#include
#include
int main()
{
float a=5.375;
char *p;
int i;
p = (char*)&a;
for(i=0; i<=3; i++)
printf("%02x\n", (unsigned char)p[i]);
return 0;
}

A. 40 AC 00 00 B. 04 CA 00 00
C. 00 00 AC 40 D. 00 00 CA 04




45.

Which statement will you add in the following program to work it correctly?

#include
int main()
{
printf("%f\n", log(36.0));
return 0;
}

A. #include B. #include
C. #include D. #include




46.

What is the output of this C code?

#include
printf("%.0f", 2.89);

A. 2.890000 B. 2.89
C. 2 D. 3




47.

What is the output of this C code?

#include
int main()
{
float a = 2.455555555555;
printf("%f", a);
}

A. 2.455555 B. 2.455556
C. 2.456 D. 2.46




48.

What will be output of following c code?

#include
int main(){
int size;
size=sizeof(void);
printf("%d",size);
return 0;
}

A. 2 B. 0
C. 4 D. Compilation error




« previous

1

2

3

4

5

6

7

8

 
 
 



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