Академический Документы
Профессиональный Документы
Культура Документы
b. we need to put break statement at the end of the group of statement of a condition c. d. we can put range for case such as case 1..3 None of above
a. The values of those variables are passed to the function so that it can manipulate them b. The location of variable in memory is passed to the function so that it can use the same memory area for its processing c. The function declaration should contain ampersand (& declaration d. All of above in its type
ANS: B
3. What will be the output of the following arithmetic expression ? 5+3*2%10-8*6 a) -37 b) -42 c) -32 d) -28
ans:A
4. What will be the output of the following statement ? int a=10; printf("%d &i",a,10); a) error b) 10 c) 10 10 d) none of these
ANS:D
5. What will be the output of the following statement ? printf("%X%x%ci%x",11,10,'s',12); a) error b) basic c) Bas94c d) none of these
ANS:B
6. What will be the output of the following statements ? int a = 4, b = 7,c; c = a = = b; printf("%i",c); a) 0 b) error c) 1 d) garbage value
ANS:A
7. What will be the output of the following statement ? printf( 3 + "goodbye"); a) goodbye b) odbye c) bye d) dbye
ANS:(D)
8. What will be the output of the following statements ? int a = 5, b = 2, c = 10, i = a>b void main() { printf("hello"); main(); } a) 1 b) 2 c) infinite number of times d) none of these
ANS: C
9. What will be the output of the following program ? #include<stdio.h> void main() { int a = 2; switch(a) { case 1: printf("goodbye"); break; case 2: continue; case 3: printf("bye"); } } a) error b) goodbye c) bye d) byegoodbye
ans:A
ANS:C (3)
ANS: (B). 0 12. What will be the output of the following statements ?
int i = 3; printf("%d%d",i,i++); a) 34 b) 43 c) 44 d) 33
(b):4,3
int a=10,b=20; char x=1,y=0; if(a,b,x,y) { printf("EXAM"); } } What is the output? 1) 2) 3) 4) XAM is printed exam is printed Compiler Error Nothing is printed
ANS:4-> NOTHING IS PRINTED 14 What would be the output of the following program? #include main() { char str[]="S\065AB";
printf("\n%d", sizeof(str)); }
1) 2) 3) 4)
7 6 5 error
ans(2)
Ans:a
16. Which of the following function sets first n characters of a string to a given character? A. strinit() C. strset() B. strnset() D. strcset()
C.efgh D.Error
ANS:A
main( ) { printf ( "\n%d%d", sizeof ( 3 ), sizeof ( "3" ), sizeof ( 3 ) ) ; } A. 12 B.123 C.1234 D. Error
ANS:a
printf("%s ",str); printf("%s ",&str); return(0); } 1. ogramming Programming Programming 2. ogramming Programming < Garbage Value > 3. Programming ogramming Programming 4. Program Compiled with Syntax Errors
ANS:1
20: char txt [20] = "Hello world!\0"; How many bytes are allocated by the definition above? A. 11 bytes
B. 12 bytes C.13 bytes D. 20 bytes
ANS:D