C Language - Data Types

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

 
37.

What will be the output of the following statements ?

int i = 1,j;
j=i--- -2; printf("%d",j);

A. error B. 2
C. 3 D. -3




38.

What will be the output of following program ?

#include
main()
{
int x,y = 10;
x = y * NULL;
printf("%d",x);
}

A. error B. 0
C. 10.000 D. garbage value




39.

long factorial (long x)

{
????
return x * factorial(x - 1);
}
With what do you replace the ???? to make the function shown above return the correct answer?

A. if (x == 0) return 0; B. if (x == 0) return 0;
C. if (x >= 2) return 2; D. if (x <= 1) return 1;




40.

Find the output of the following code snippet print?

int iNumber1 = 10, iNumber2 = 20;
if (iNumber1 = 0)
{
iNumber2 = 50;
}
printf("%d %d",iNumber1,iNumber2);

A. 0 20 B. 10 20
C. 0 50 D. 10 50




41.

What would be the Output of this Program ?

#include
void main()
{
char y='a';
int x=10;
float z=10.1;
printf("\nSizeof(int) : %d Byte",sizeof(int));
printf("\nSizeof(char) : %d Bytes",sizeof(char));
printf("\nSizeof(float) : %d Bytes",sizeof(float));
}

A. Sizeof(int) : 2 Byte
Sizeof(char) : 2 Bytes
Sizeof(float) : 4 Bytes
B. Sizeof(int) : 2 Byte
Sizeof(char) : 2 Bytes
Sizeof(float) : 8 Bytes
C. Sizeof(int) : 2 Byte
Sizeof(char) : 1 Bytes
Sizeof(float) : 4 Bytes
D. Sizeof(int) : 2 Byte
Sizeof(char) : 2 Bytes
Sizeof(float) : 8 Bytes




42.

Find the output of the following program?

#include
int main(int argc, char ** argv)
{
int iValue=1;
do {
printf("%d ",iValue);
} while( --iValue );
return 0;
}

A. 0 B. 10
C. Nothing will be displayed D. 1




« previous

1

2

3

4

5

6

7

8

next »

 
 
 



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