Você está na página 1de 5

1. 2. 3. 4. 5. 6.

what are the two basic operations performed on stack Elements in the stack can be deleted from both the ends of the stack(T / F) Write one application of the stack Stack implemented using array is Dynamic in nature(T / F) write prefix expression for A + B * C / D E Queue is _________________ a) b) c) d) AIAO LILO FIFO None of the above

2. The C language terminator is (a) semicolon (b) Colon (c) period (d) exclamation mark 3. What is false about the following -- A compound statement is (a) A set of simple statements (b) Demarcated on either side by curly brackets (c) Can be used in place of simple statement (d) A C function is not a compound statement. 4. What is true about the following C Functions (a) Need not return any value (b) Should always return an integer (c) Should always return a float (d) Should always return more than one value 5. Main must be written as (a) The first function in the program (b) Second function in the program (c) Last function in the program (d) Any where in the program 6. Which of the following about automatic variables within a function is incorrect? (a) Its type must be declared before using the variable (b) They are local (c) They are not initialized to zero (d) They are global

7. Write one statement equivalent to the following two statements: x=sqr(a); return(x); Choose from one of the alternatives (a) return(sqr(a)); (b) printf("sqr(a)"); (c) return(a*a*a); (d) printf("%d",sqr(a)); 8. Which of the following about the C comments is incorrect? (a) Comments can go over multiple lines (b) Comments can start any where in the line (c) A line can contain comments with out any language statements (d) Comments can occur within comments 9. What is the value of y in the following code? x=7; y=0; if(x=6) y=7; else y=1; (a) 7 (b) 0 (c) 1 (d) 6 10. Which of the following represents true statement; x is in the range of 10 and 50 or y is zero (a) x >= 10 && x <= 50 || y = = 0 (b) x<50 (c) y!=10 && x>=50 (d) None of these 11. Which of the following is not an infinite loop ? (a) while(1){ ....} (b) for(;;){...} (c) x=0; do{ /*x unaltered within the loop*/....}while(x=2); (d) # define TRUE 0 ... while(TRUE){ ....}

17. What is the Output of the following code #include<stdio.h> int main() { static int array[6][2]={ {' ','s'},{'d','r'},{'a','w'}, {'k','c'},{'a','b'},{'c','d'}}; int *p=(int *)(array+4); for(++p; p>=(int *)array; putchar(*p--)); return 0; } 1 backwards 2 ab aw dr 3 ackward 4 Error 18 How many bytes of memory will be set aside for start? struct employee { int a; int b; }; typedef struct employee * Node; main() { Node start; start=(Node)malloc(sizeof(Node)); } 1 code is invalid 2 4 bytes 3 8 Bytes 4 Compile time error 19. int i=5; int abc(int z) { return i/2; } main() { int i=4;

printf("%d",abc(i=i/4)); } Output is 1 error 2 5 3 2 4 0 20. union U { short x; float y[4]; char s[20]; double d; }; union U ob; size of ob in bytes is: 1 46 28 3 22 4 20 21. The pointer equivalent of a[i][j] is 1 ((*a+i)+j) 2 *(*(a+i)+j) 3 **a+i+j 4 None of the choices 22. Which one of the following makes use of stack? i) function calls ii) register variables iii) automatic variables 1 (i),(ii) 2 (ii),(iii) 3 (i),(iii) 4 (i),(ii),(iii) 23. int a=3, b=4, *p=&a, *q=&b, r=*p**q; printf("%d\n",r); Output will be

1 invalid indirection 2 12 3 addresses will be multiplied and result will be 4 none of the given options 24. If a variable is Global and Static then, the Scope of Variable is 1 Limited to file in which it is declared 2 can be Accessed By Function in other file 3 None of the choices 25. #define SQR(x) x*x main() { printf("%d\n",SQR(10+2)); } Output will be 1 32 2 144 3 error 4. none of the above

Você também pode gostar