You are on page 1of 6

(1)What will be output of the following program? #include<stdio.h> int main(){ float a=0.7;d if(a<0.

7){ printf("C"); } else{ printf("C++"); } return 0; } (2)What will be output of the following program? #include<stdio.h> int main(){ int i=5,j; j=++i+++i+++i; printf("%d %d",i,j); return 0; } (3)What will be output of the following program? #include<stdio.h> int main(){ int i=1; i=2+2*i++; printf("%d",i); return 0; } (4)What will be output of the following program? #include<stdio.h> int main(){ int a=2,b=7,c=10; c=a==b; printf("%d",c); return 0; }

(5)What will be output of the following program? #include<stdio.h> void main(){ int x; x=10,20,30; printf("%d",x); return 0; } (6)What will be output of the following program? #include<stdio.h> int main(){ int a=0,b=10; if(a=0){ printf("true"); } else{ printf("false"); } return 0; } (7)What will be output of the following program? #include<stdio.h> int main(){ int a; a=015 + 0x71 +5; printf("%d",a); return 0; } (8)What will be output of the following program? #include<stdio.h> int main(){ printf("%d %d %d",sizeof(3.14),sizeof(3.14f),sizeof(3.14L)); return 0; } (9)What will be output of the following program? #include<stdio.h> int main(){

int x=100,y=20,z=5; printf("%d %d %d"); return 0; } (10)What will be output of the following program? #include<stdio.h> int main(){ int a=2; a=a++ + ~++a; printf("%d",a); return 0; } (11)What will be output of the following program? #include<stdio.h> int main(){ int a; a=sizeof(!5.6); printf("%d",a); return 0; } (12)What will be output of the following program? #include<stdio.h> int main(){ float a; (int)a= 45; printf("%d,a); return 0; }

(13)What will be output of the following program? #include<stdio.h> int main(){ int i=5; int a=++i + ++i + ++i; printf("%d",a); return 0; }

(14)What is the output of this C code? #include <stdio.h> printf("%.0f", 2.89); a. 2.890000 b. 2.89 c. 2 d. 3

(15)What is the output of this C code? #include <stdio.h> int main() { float a = 2.455555555555; printf("%f", a); } 2.455555 2.455556 2.456 2.46

a. b. c. d.

(16)Which of the following % operation is invalid? a. 2 % 4; b. 2 % 4l; c. 2 % 4f; d. Both (b) and (c) (17)Which data type is suitable for storing a number like? 10.0000000001 a. int b. float c. double d. Both (b) and (c) (18)Modulus for float could be achieved by? a. a % b b. modulus(a, b);

c. fmod(a, b); d. mod(a, b); (19)Predict the data type of the following mathematical operation? 2 * 9 + 3 / 2 . 0 a. int b. long c. float d. double (20)%lf is used to display a. float b. long float c. double d. All of the mentioned

You might also like