Questions
Question 1 Multiple Choice (Single Answer)
What would be the output of the following C program?
int n=2, m=3, k;
k = (float)m/(float)n;
printf(k=%0.5d,k);
- k=1.00000
- k=0.00000
- k=00000.1
- k=00001
Question 2 Multiple Choice (Single Answer)
What would be the output of the following C code?
int i=1, j=1; int n = 1;
if(n>0){i++;j--;}printf(i=%d, j=%d,i, j);
- i=0 j=0
- i=2 j=2
- i=2 j=0
- i =1 j=1
Question 3 Multiple Choice (Single Answer)
Consider the following C statement: int i = 5, n = 2, z;z = (i! =n) || i>n && n;
printf(z = %d,z);
What would be the value of 'z'?
- z = 0
- z = 1
- z = garbage value
- Compiler error
Question 4 Multiple Choice (Single Answer)
void main(){int *x, y;y=10;x=&y;
printf(Value of y=%d n, y);
printf(Value of y=%d n, *x);}
What is the output of the above C code?
- 10 00
- 10 20
- 10 10
- Compiler Error
Question 5 Multiple Choice (Single Answer)
Consider the following 'C' code and write the output obtained.int a[3][3] = {{1,2,3,4},{5,6,7,8}};
printf(%d,a[0][2]);
- 1
- 2
- 3
- 4