C Programming

1. main( ) { int x = 10, y = 20;/. x =!x; y =!x&&!y; printf(“x =%d y =%d”, x, y); } a) x = 10 b) x = 0 y = 20 y=0

c) x = 20 y = 10

d) None

2. main( ) { int x = 5; x++; printf(“x =%d\n”, x); ++x; printf(“x = %d\n”, x); } a) x = 5 b) x = 6 c) x = 7 x=7 x=7 x=5 3. main( ) { int x = 10, y =x, z =x; y = x; z = -x; t = - x; printf(“y =%d z=%d t=%d”, y, z, t); } a) y = -10 b) y = 0 c) y = 0 z=0 z = -10 z = -10 t = -10 t = -10 t = -10 4. main( ) { int i; for(i = - 1; i < = 10 ; i + +) { if ( i < 5 ) continue ; else break; printf(“Gets printed only once!!”); }} a) No output b) Gets printed only once

d) None

d) None

c)Error

d) None

5. main( ) { int i =135, a =135, k; k =function(!++i, !a++); printf(“i =%d a=%d k=%d”, i, a, k); } function(j, b) int j, b; { int c; c = j + b; return( c ); }
a)

i = 136 a = 135 k=0

b) i = 136 a = 136 k=0

c) i = 135 d)None a = 136 k=0

6. main( ) { int k = 35, z; z = func(k); printf(“z =%d”, z); } func(m) int m; { + +m; return(m = func1 (++m)); } func1(m) int m; { m ++; return(m); } a) z = 38 None 7. main( ) { if(printf(“C for yourself how it works\n”)) main( ); } b) z = 36 c) z = 37 d)

a)error d) None

b) C for yourself it works

c) C for yourself how it works C for yourself how it works C for yourself how it works C for yourself how it works …….. ………. …….. ……. ……… ……… ………. …

8. main( ) { int i = 1; if(!i ) printf(“Recursive calls are real pain!”); else { i = 0; printf(“Recursive calls are challenging\n”); main( ); } } a)Recursive calls are challenging b) Recursive calls are challenging c) Error d) None Recursive calls are challenging Recursive calls are challenging . ……… ……….. ………….. ……… ………. …………… 9. int i = 0; main( ) { printf(“in main i =%d\n”, i); i ++; val( ); printf(“in main i =%d\n”, i); } val( ) { int i = 100; printf(“in val i = %d\n”, i); i ++; } a) 101 1 10. #define NO #define YES main( ) { int i = 5, j; b) Error message c)1 100 d) None

if( i > 5) j = YES; else j = NO; printf(“%d”, j); } a) Yes Yes Yes Yes Yes Yes b) Error Message c) None d ) No No No

11. #define AND && #define OR || #define LE <= #define GE >= main( ) { char ch = ‘D’; if((ch GE 65 AND ch LE 90) OR (ch GE 97 AND ch LE 122)) printf(“Alphabet”); else printf(“Not an alphabet”); } a) No Alphabet b) Alphabet c) error d)None

12. main( ) { int n[25]; n[0] = 100; n[24] = 200; printf(“%d %d”, *n, *(n + 24) + *(n + 0)); } a) 200 100 b) 100 300 c) 100 200 d) None

13. main( ) { int arr[ ] = { 0, 1, 2, 3, 4}; int i, *ptr; for(ptr = arr + 4; ptr = arr; ptr--) printf(“%d”, *ptr); } a) 0 1 2 3 4 b) 4 3 2 1 0 c) 1 2 3 4 0 d)None
14.

main( ) { static char s[ ] = “Rendezvours!”; printf(“%d”, *(s + strlen(s)));

} a) Hacker. struct s1*ptr. 48. main( ) { struct employee { char name[25].name = “Hacker”. 48. 48. 25 b) Error message 17. char *s. 48}. 48. static struct s1 a[ ] ={ c) 25 Hacker d) None . 48. }. } } a)0 0 0 0 0 0 0 0 0 0 b) 1 1 1 1 1 1 1 1 1 1 c) 48 48 48 48 48 48 48 48 48 48 d) None 16. i++) { if(*s) printf(“%c”.age). main( ) { struct s1 { char*str. for(i = 0. 48. e. 48. int i. s = str. e. printf(“%s%d”. }. i <=9. b) 1 main( ) c) e d) None { static char str[ ] = { 48. int i.age = 25. e. int age. float bs. *s).name. e. struct employee e.} a) 0 15. 48. s++.

1.{“Nagpur”. p->data = 75. p->data). } } . p->previous = NULL.str). a + 1}. }. while(p!=NULL) { printf(“%d\n”.i). q->data = 90. j <=2. q = malloc(sizeof (struct node)). ++a[j]. {“Raipur”. int j. struct node *next. {“Kanpur”. j++) { printf(“%d”. struct node *p. *q. q->next = NULL. b) 0 1 2 agpur aipur anpur c) 0 1 aipur d) None agpur 2 anpur #define NULL 0 main( ) { struct node { struct node *previous. p =p->next. 2. p->next = q. a} }. } } a) 1 aipur 0 agpur 2 anpur 18. p = malloc(sizeof(struct node)). int data. --a[j]. a + 2}. struct s1*p = a. for (j = 0. 3. q->previous = p. printf(“%s\n”.

char y[3].bb. union c { struct a aa. d). c =1. } a) d=2 d=2 b) d = 3 d=3 c) d = 1 d=1 d) None b) 0022 c) 0202 d) None . }. printf(“%d%d”.i = 512. u.y[1]. printf(“d = %d\n”. u.aa. d = a| b & ~ c.x. main( ) { int a = 3.y[0]).bb. d = a| b & c.bb. printf(“%d%d”. u. struct b bb. union c u.a) 90 75 19. u. b = 2. u. d. struct b { char x.bb. }. u.aa. printf(“d =%d\n”.y[2]). d). } a)2020 20. int j. }.j = 512. main( ) { struct a { b) 75 c) 90 d) None 90 90 int i.

main( ) { int b. 24. 1 6 b. printf(“%d %d”. } int f(int a) { a>20?return (10):return (20). 10 c. None c. 6 6 22. return a. Error 23. 3 b. } a. b=f(20).sizeof(a).int b) { int a. Error 25.i)). } a. printf(”%d”. a=20. main( ) { int i=3. b.int b) c. i=i++.21. char *b=”Bombay”. No output d. f (int a. 4 d. None of the above. #define sqr(x) (x*x) main( ) . What error would the following function give on compilation.b).sizeof(b)). Redeclaration of a. d. main( ) { static char a[]=”Bombay”. 1 1 c. printf(“%d”. The function should be defined as int f(int a. } a. 20 b. Missing parantheses in return statement. undefined d. } a.

2 2 2 c. } a. main( ) { printf(“%d %d %d”. Error d. Garbage value 26 #define str(x) #x #define Xstr(x) str(x) #define oper multiply main( ) { char *opername=Xstr(oper). 31. multiply c. 1 2 2d. main( ) { struct emp{ .*((int *)p+4)).”abcdefgh”[4]). m c.b=3. main( ) { printf(“%c”. 1 1 1 b. 25 b.30. a b. main( ) { printf(“%c”. None d.sizeof(3)). } a. None 30. 50 b. None d. printf(“%s”. a=sqr(b+2). Error d. } a. printf(“%d”. } a.40. } a. 10 c.sizeof(“3”). printf(“%d”. \0 28. 1 1 1 Note: Assume size of int is 2 bytes.sizeof(‘3’). S b.50}. e c. Error d.{ int a. main( ) { int a[ ]={10. Error 29. 11 c.7[“sundaram”]). char *p. oper b. } a.20. Error 27. p=(char *)a.opername).a).

count++) { if(count %2) continue. **p). else if(count %8) continue. count). main( ) { char a[ ]. printf(“%s”.char n[20]. main( ) { int count. int age. count<=end. d.} struct emp e1={“david”. if(e1= = e2) printf(“structures are equal”). for (count=1. else printf(“%d”. else if(count %6) continue. a. } a) Compilation Error b) No output c) A d) None 33. c.23}. main( ) { char **p =”Hello”. } structures are equal No output Error None 32. a[0] = ‘A’. else if(count %4) continue. printf(“%c”. b. else if(count %12) continue. else if(count %10) continue. } . } a) Hello b) **p c) Error d) None 34. end=20. a[0]). struct emp e2=e1.

main( ) { printf(“i = %d”. x++. ++x). int i = 0. } val( ) { i =100. 6 c) 5. i). a). z)). } a) Error b) 6. } a) 0 b) -1 c) Error d) 5 36. return 0. printf(“ %d %d “. 6 37. printf(“After i=%d”. i++. } The output is a)No display b) Error c) 20 21 d) 21 35. count). 7 d) 7. printf(“val’s i=%d\n”. main( ) { int a=5. val( ). do { printf(“%d\n”. i++. z.printf(“%d”. printf(“%d %d”. val( ). printf( “%d”. d) Error . i). i). main( ) { int z = 4. a = -1. } a) 4 4 3 b) 4 4 5 c) 4 4 4 38. main( ) { int x = 5. } while (a>0).

20. { main( ) int i. main( ) { int a[ ] = { 10. printf( “%d %c \n”). 30. } a) LOWER CASE b) UPPER CASE c) ERROR-COMPILE d) RUN-TIME ERROR 42. return 0.} a) i =0 b) i=0 val’s i=100 val’s i =100 i =1 i=101 val’s i =100 val’s i =100 39. switch( i ){ case 1 : printf( “Do”). case 2 : printf( “ Re “). scanf( “%d”. # define COND(a > = 65 & & a < = 90) main( ) { char a = ‘R’. }} The output will be a) DO Re SACHIN b) SACHIN c) Do Re d) Error 41. 50}. } a) Error c) Error d) None of the above b) d c d c c) Compilation error d) Some garbage value will be the output 40. case default : printf( “ SACHIN “). . else printf(“ LOWER CASE”). int j. if (COND) printf(“ UPPER CASE”). main( ) { printf( “%d %c \n”). 40. &i).

printf( “ %d”. main( ) { int a[5] = {2. j++) { printf(“ \n %d”. printf(“\n %d %d”. 50} char *p. b =5. 30. i++) { f(a[i]. for(i=0. printf(“%d”. p = (char *) a. int *y) { x = *(y) +=2.. } (a) 6 7 (b) 7 6 ( c ) 1 7 ( d ) 0 7 . &b). int i. 8. main( ) { int a. } } a) 0.for (j = 0. 40. } } f(int x. } a) 2 7 4 9 6 11 8 13 10 15 b) 4 9 6 11 8 13 10 15 12 17 c) 7 9 11 13 15 2 4 6 8 10 d) Error 45. b). } a) 50 b) 10 c) Error d) None 44. a=b). a = =b).. main( ) { int a[ ] = { 10. i<5. a ++.5 b) 0. * ((int*) p+4)). b=7. j < 5.4 c) Error d) None of the above 43. 6. a[i]. printf(“%d”. * a). 10). 20.b. 4.

} while (i++ <5| | ++ch < =’F’). int count. Which of the following statement is correct regarding the assignment d=a < b < c . } The output of above program is (a) ABCDEF (b) AAAAAA BCDEF ( c) A will be displayed infinitely (d)None of the above 48.46. char ch = ‘A’ do { printf(“%c”.b and c are 2. (a) Above statement is syntactically not correct (b) Value zero will be stored in variable d (c) Value one will be stored in variable d (d) Value -1 will be stored in variable d 49.3 and 1 respectively. c--).. ch).. i = i +n. sum. } The end value of i is (a)210 (b) 20 ( c) -1 (d) 200 47. Values of a.b. while(n.count). i = 0. main ( ) { int n=20. main( ) { static int c =5. } (a) (b) (c) (d) Programs goes into an infinite loop 356653 will be displayed 354453 will be displayed None of the above 50.1. printf(“%d”. . sum). printf(“%d”. sum + = . Assume that a. main( ) { int i = 0.>0). main( ) { for(count = 4. if (c ) main( ).c are integer variables.

New)-(New. int i=10.} 5 5 5 5 5 (b) 5 4 3 2 1 (c ) 5 4 3 2 1 0 (d) None of the above 1) what will be the result of executing following program main( ) { char *x="New". t=x.New) d). } void f(int i.i++).int j) { . y=x.(New. char *y="Dictionary".x. %s)".x.char *y) { char *t.y). void swap (char * . printf("(%s.Dictionary)-(New. x=y. f(i. x=y. char *t. y=t. printf("-(%s.(Dictionary. swap (x. %s)".y).New)-(Dictionary. } a). char *t. } void swap (char *x.y). char *).New) 2) What will be result of the following program main() { void f(int.Dictionary)-(Dictionary.(Dictionary.Dictionary) c).(New. y=t.int).Dictionary) b).

char y.i++) { switch(i) case 0:i+=5.53 c)21. for(i=0.17 c)12.j).53.13. case 5:i+=5.85.if(i>50) return.85 d)none of the above 3)What is the size of 'q'in the following program? union{ int x.22 d)16.".32.5. a)11 b)6 c)4 d)5 4)Result of the following program is main() { int i=0.".32. char y. f(i.21 . } a).21 b)10.32. i+=j.i). break.i<20. printf("%d.53.9. }q. case 1:i+=2.} printf("%d.i).}p. struct { char x.11. default i+=4.9.17.13.17 b)5. int xy.21. } } a)0.

Pass2 b)Pass1. else printf("Fail2"). e.name = “ Hacker”. if(i<u) printf("pass2"). float bs. printf(“%s%d”. b)increments value pointed by p c) increments both d none of the above d) None of the above .5)What is the result main() { char c=-64. 25 b) Hacker 25 c) Error 7) *p++ a)increments p.").Fail2 c)Fail1. else printf("Fail2") } a)Pass1.name. int i=-32 unsigned int u =-16. e. e.age). } struct employee e. e.Pass2 d)Fail1. if(c>i){ printf("pass1.Fail2 e)none 6) main( ) { struct employee { char name[25]. int age. } a) Hacker.age = 25. if(c<u) printf("pass2").} else printf("Fail1).

printf(‘%d”. The function should be defined as int f(int a.w 8) What's wrong with the code "char c. 3 b. return a. None of the above.int b) { int a. } a.sizeof(b)). d. undefined d. 1 1 c..sizeof(a). Error 11What error would the following function give on compilation. a=20. printf(“%d %d”. I=I+ +.. while((c = getchar()) != EOF) . char *b=”Bombay”. 4 c. Redeclaration of a. Missing parantheses in return statement. f (int a. 1 6 b."? a) EOF cannot be used in while loop b) EOF cannot be used with getchar c) C should be an integer d) None of the above 9) What is the O/P of the program given below main( ) { static char a[]=”Bombay”. 2 )#define str(x) #x #define Xstr(x) str(x) #define oper multiply main( ) { . b. } a. 6 6 d. } a.int b) c.I)). None 10 What is the O/P of the program given below main( ) { int I=3.

None 15)When a array int arr[MAXROW][MAXCOL] is passed to a function fun( ) then the function fun( ) will be defined as a.opername). 1 1 1 18)main( ) { . Error d.”abcdefgh”[4]). 1 2 2d. a b. fun(int (*ptr)[MAXCOL])) d.7[“sundaram”]).sizeof(3)). } a. p=(char *)a. S b. fun(int a[ ][MAXCOL]) b. Error d. oper b.*((int *)p+4)). 1 1 1 b.40. } a.char *opername=Xstr(oper). 10 c. printf(“%s”. m c. } a. char *p. Error d. printf(“%d”. None 13)main( ) { printf(“%c”.sizeof(‘3’).50}.sizeof(“3”). e c. Error d.30. 50 b. fun(int a[ ]) 16)main( ) { printf(“%c”. 2 2 2 c. } a. fun(int a[ ][MAXROW]) c. \0 14)main( ) { int a[ ]={10.20. } a. None 17)main( ) { printf(“%d %d %d”. multiply c.

C List of all . struct emp e2=e1. if(e1= = e2) printf(“structures are equal”).} struct emp e1={“david”.”r”). i++) Printf(“%s”. b. argv [I]). } structures are equal No output Error None 19)main( ) { FILE *fp. a.23}. char *argv[ ]) { int i.struct emp{ char n[20]. d.c” What would be the output? main (int arg c. c. int age. } fp points to a) The first character in the file b) A Structure which contains a char pointer which points to the first character in the file. d) None . c) Name of the file d) None of the above 20)If the following program (myprog) is run from the command line as myprog “*. for (i=1.C files in the current directory “*. fp=fopen(“x1”.C” None 21)Which of the following is true about argv? a) It is an array of character pointers b) It is a pointer to an array of character pointers c) It is an array of integers. } a) b) c) d) *. i<argc.

} The output is a) Programming b) rgamng c) Pormig d) None 24)float *(* x[20]) (int *a) a) x is array of pointer to functions accepting integer pointer as an argument and returning a pointer to float. count<=end. else if(count %4) continue. b) x is pointer to a function which accepts an array of pointers and returns a float c) x is a pointer to a function that accepts a pointer to an integer array and returns a character d) None 25)Declaration for a pointer to function pointer that accepts an argument which is an array of pointer 5 integers and returns a pointer to a character is a) char * (* ptr) (int * a[5]) b) char (*x) (int (*a) []) c) char * (*x) (int a[5]) d) char * (*x[5]) (int a[5]) 26) main( ) { int count. for (count=1. count++) { if(count %2) continue. char *[ ]= “Programming”. x[a]). x[a]! = ‘\0’. } a) m b) f c) myprog d) Friday 23)main( ) { int a. a++) if (( a%2 = =0) printf(“% C”. end=20. else . char *argv[]) { printf(“%C”.22)If the following program (myprog) is run from the command line as myprog Friday Tuesday Sunday What would be the output? main(int argc. (* ++ argv)[0]. for (a=0.

300 b) 100 200 c) Error d) 300. scanf( “%d”. * n. *(n+24) + *(n+0)). &i). }} The output will be a) DO Re SACHIN 29) . case default : printf( “ SACHIN “).if(count %6) continue. count). } The output is a)No display b) Error c) 20 21 d) 21 27) main( ) { int n[25]. else if(count %10) continue. main( ) { int b. else printf(“%d”. b = f(20). switch( i ){ case 1 : printf( “Do”). n[0] = 100. n[24] = 200. printf(“\n%d%d”. case 2 : printf( “ Re “). count). 100 b) SACHIN c) Do Re d) Error . else if(count %8) continue. else if(count %12) continue. } a) 100 28) main( ) { int i. } printf(“%d”.

4}. }. a + 1}. . struct s1*p = a. int i. a + 2}. j++) { printf(“%d”. 1. 3. ++a[j]. 1. int *ptr. for (j = 0. for (ptr = &arr[0]. } a) 20 b) 10 c) No output d) Error 30) main( ) { int arr[ ] = { 0. 3.. } a) 0 1 2 3 4 b) 1 2 3 4 5 1) main( ) { struct s1 { char*str. a} }.i). b). int j.str). struct s1*ptr. ptr <= &arr[4].printf( “%d”. printf(“%s\n”. } } a) 1 aipur 0 agpur 2 anpur b) 0 1 2 agpur aipur anpur c) 0 1 2 aipur d) None agpur anpur c) Error d) Some Garbage Value . static struct s1 a[ ] ={ {“Nagpur”. ptr++) printf(“%d”. 2. {“Raipur”. 2. {“Kanpur”. j <=2. *ptr).-a[j]. } int f(int a) { a>20 ? return(10) : return(20).

struct b bb. union c { struct a aa. } } a) 90 b) 75 c) 90 d) None 75 90 90 3) main( ) { struct a { int i. p = malloc(size of(struct node)). p =p->next. int data. *q. }.2) #define NULL 0 main( ) { struct node { struct node *previous. struct node *p. q->data = 90. }. char y[3]. p->data = 75. struct node *next. p->previous = NULL. p->next = q. a->next = NULL. int j. . struct b { char x. q = malloc(size of (struct node)). p->data). }. q->previous = p. while(p!=NULL) { printf(“%d\n”.

*p).h> .}.{‘p’. c) d).y[2]). b = 2. u. printf(“%s\n”.’r’}.{‘x’. Abcpqrxy None of the above What will be the output of this program? #include<stdio. u. printf(“%d%d”. d. *p=a[0]. } a) d = 2 d=2 5) What is the output? line 1 main ( ) line 2 { line 3 line 4 line 5 line 6 line 7 a)Abc b)Compilation error 6.y[1].}} char**p. d = a| b & c. c =1. } a)2020 b) 0022 c) 0202 d) None 4)main( ) { int a = 3. u.bb. u.’c’}. u.y[0]).bb.j = 512. d = a| b & ~ c. d).’q’. union c u. u.aa.’y’. } char a{3}{3}= b) d = 3 d=3 c) d = 1 d=1 d) one {{‘a’.x.’b’. printf(“d = %d\n”. printf(“d =%d\n”.i = 512.aa.bb. printf(“%d%d”.bb. d).

. 200 None of the above 8..... minmax=(var1>var2)?(var1>var3) ? varl:var3:(var2>var3)? var2:var3.void main(void) { int varl=5. c = add.. printf(“%d\n”. 100 100 200 c. y = 4... To get the output c=0 d=2 What should be coded in the blank space? main( ) { enum code { add.. } a.d. delete.... d...... modify. unchanged }.. Typedef code CODE Typedef enum code c. z = 4. } a.. Produce a runtime error Produce a compilation error c.. printf("ans=%d"... } This program will a. d.. d. CODE c. b. b. b.minmax)..var2=5.. printf("c=%d d=%d".. .d). 7....minmax.var3=6. z >= y && y >= x ? 100:200). d = modify. . typedef enum code CODE None of the above .. Print 5 Print 6 What will be the output of the following program? main( ) { int x = 1.c.

a. while(getch(fp)!=EOF None of the above 10)What will be the output of the following program? #define ISLOWER(a) (a >= 97 && a <= 127) #define TOUPPER(a) (a-32) main( ) { char ch='c'. if(ISLOWER(ch)) ch=TOUPPER(ch).2.round world!*/ fp=fopen(“TRIAL. while(i<5).) is equivalent to 1. While(fgets(Str. a.80. if(i<5) statements. 2. 99 b. puts(str). what should be coded in the blank space. 1. } a. None of the above 11)for(.ch).C". b. 1.C contains only one line: it’s a round.3 b. ________________________ .round. 3. C d. Char str[80].fp)!=EOF) While(fp!=NULL) c. 2 c."r"). round. /*TRIAL. C c.9 #include"stdio. i<5. do statements. while(i<5) statements.h" main( ) { FILE *fp. round world!" in an infinite loop. } To get this output "its a round. printf("%c". d.2 d. 1 12) If a = 010011 then a << 2 is .

exit(1) } while((c =getc(fp))! = EOF) . *k). printf(“%f%f ”. *k.a. 1. *j. char c.5} float *j. “.24.h” main( ) { FILE *fp. d. if(fp = NULL) { puts(“Cannot open file”). b. *(s+ strlen(s))). fp = fopen(“TRY. } a) Error b) Some value c) No output d) None of the above 15)main( ) { static char s[ ] = “Rendezvous”. If you are using “open” function for opening a file the file handle should be of ____________ type. j = j * 2. printf(“%d”. k = a + 2. 010110 011100 101100 None of the above 13. j = a. } a) 0 b) Rendezvous c) ‘\0’ d) Error 16)# include “stdio.C. c. k = k/2. a) b) c) d) FILE int char None of the above 14)main( ) { static float a[ ] = { 13.”r”).

putch(c ). default: printf(“BAI”). float y.x. void main(void) { struct s{ int x.00 d) Produce a runtime error */ . case(ch >=97 && ch<=122): printf(“small case letter”). }s1 = {25. break.u1.00}. float y. }u1.45.h> void main(void). printf("%d and %f".y). fclose(fp). u1=(union u)s1. } a) Error b) No output c) Each character read would be displayed on the screen 17)main( ) { char ch = `E` switch(ch) { case(ch > = 65 && ch < =90): printf(“Capital Letter”).00 b) Produce a compilation error c) 45 and 45. break. union u{ int x.u1. } /* What will this program point ? a) 25 and 45. } } a) Error message b) Capital Letter c)small case letter d) BAI 18) Carefully go through the following code #include <stdio.

case 1 : printf("To All \t"). #include <stdio. } This program will a) Produce a runtime error b) Produce a compilation error c) Print 5 d) Print 6 21) Consider the following C program. printf("%d\n". switch(c&x) { case 3 : printf("Hello! \t").var2=5.minmax). default: printf("\n"). what will be the output of the program ? a) The program will generate a compile time error as there is no break statement for the various case choices.h> void main(void) { unsigned int c.minmax. scanf("%u". } } If the value input for the variable c is 10.h> void main(void). b) The program will print Hello! c) The program will print Welcome To All d) None of the above 20) Study the following program #include <stdio.var3=6. #include <stdio. case 2 : printf("Welcome \t"). unsigned x=0x0003.h> void main(void) .19) Consider the following C program. minmax = (var1 > var2) ? (var1 > var3) ? var1:var3:(var2 > var3) ? var2:var3.&c). void main(void) { int var1=5.

b.&c). switch(c&x) { case 3 : printf("Hello! \t").{ unsigned int c. d. unsigned x=0x0003. default: printf("plain simple goodbye!").5. } } If the value input for the variable c is 10. *k. } } a. 23. scanf("%u". case 2 : printf("Welcome \t"). what will be the output of the program ? a) The program will generate a compile time error as there is no break statement for the various case choices.4. . au revoir adieu None of the above What will be the output of the following program? main( ) { static float a [ ]={13.3. case 1 : printf("To All \t"). What will be the output of the following program? main( ) { int i=3. b) The program will print Hello! c) The program will print Welcome To All d) None of the above 22.24.5}. float *j. switch (i) { case 1: printf("au revoir!”). case 3: continue.1.5. plain simple goodbye Error c.1. default: printf("\n").5. case 2: printf("adieu!").

b. What will be the output of the code given below? main ( ) { int c =0. z->I=300. printf("%f %f". struct xyz *z.5 15.*k).d=5.*j.e=10. Compilation error Runtime error What is the output of the following code? main ( ) { struct xyz { int I. int k. z->k=100. a=c>1?d>1||e>1? 100:200:300. 300 200 100 .j=a.300}. abc(z) } abc(char *p) { p++. 13. k=k/2. b. 5 1 2 None of the above 25. c.a). } a. d. } a. } pqr = {100.4 c. z=&pqr. j=j*2.5 5. 24. b. k=a+4. printf(“a=%d”. a. } a. d.24 1.*p). printf(“%d\n”. c.

j=5.. printf(“%d. 26. d.”.I). c.k=0.1. switch (I) { case 0: I++ .I).k). } a.”. case 2: printf(“%d.11.d. c. What will be the output of the following ‘C’ program? main ( ) { int I=0. b. Error .I).j.I...”.. 1...... Error What will this program print? #define MAX (x.++j).1. 1. printf(“%d…%d…%d”. k=MAX(I++.1. } } a..13 12. d.. 11…12…13 12.y)(x)>(y)>(y)?(x)(y) main ( ) { int I=10.. 1.6…11 None of the above 27.. b.. case 1: printf(“%d..

“green”. printf(“%s\n”. .32.*--*++p+3). What will be the output of the code given below? main ( ) { static char *s [ ] ={ “ice”. 10.53 c. int i=10.32.**++p). fp=fopen(“TRIAL. printf(“%s\n”.85 d. None 30.C”.53.28.i++).int).j). int j) { if(i>50) return. fclose(fp).p[-1][-1]+1). What will be the output of the following code? main ( ) { FILE*fp.i). char ***p=ptr.53. “please” }. f(i.21 b.”r”).s}. printf(“%s\n”. } A cone ase reen B ase cone reen C reen ase cone D None 29 What will be the result of the following program? main ( ) { void f(int.s+2.32. i+=j. “cone”.11. static char **ptr[ ]={s+3.21.s+1. 21. printf(“%s\n”. } void f(int i. f(i. } a.*p[-2]+3). 85. printf(“%d”.

C if existing will be opened in read mode Error will be generated because c file cannot be opened through fopen Error will be generated because fclose( ) cannot be given with the file pointer None of the above What is the value of i after the following function is executed 17 times void test ( ) { static float i=0.5 c.} a. b. d. } a. 15. } a.5. transform(&m). b. i=7.0 32. d. d.0 0.0.5 15+16*7. 7. c. 18 24 3 Erroneous program as a register variable has no address _______________________________________________________________________ _ . What is the value of m when the following program runs? void transform(register int*x) { x+=5*3. c.5. } void main ( ) { register int m=3. i=+=7. 31 The file TRIAL. b.

Coding Indexing Error detection Controlling 2. Modulation Demodulation Synchronizing Desynchronozing 5. d. b. Serial parallel series parallel direct . b. Makes logic decisions Allows electron flow in only direction Works on binary algebra Alternates between 0 and 1 4. Intel 8008 b. Intel 8080 c. Communication between computers is always a. d. 3. c. A logic gate is an electronic circuit which a. d. b. c.FUNDAMENTALS OF COMPUTERS 1. b. c. A distributed data processing configuration in which all activities must pass through a centrally located computer is called a. The process of converting analog signal into digital signals so they can be processed by a receiving computer is referred to as a. b. What was the name of the first commercially available Microprocessor chip? a. Ring Network Spider network Hierarchical Network Data control Network 6. c. d. Intel 4004 d. c. d. Motorola The parity bit is added for ______________ purpose a.

. Sequential and direct Batch and timesharing Direct and interactive Batch and interactive 8. Multiprogramming was made possible by a. c. A. Two basic types of Operating Systems are a. b.7. Utility software Specific software End-user software Practical software 10 Which of the following is not the characteristic of a relational database model a. DML DDL Query language Any of the Above 12. d. b. square box a circle a rectangle an arrow 13. c. Tables Treelike structure Complex logical relationship Records 11. c. c. c. The language used in the application programs to request data from the DBMS is referred to as the a. What is the alternative name for application software a. Decision trees are easier for most people to understand than decision tables. d. b. c. d. d. In data flow diagrams. Input/Output units that operate independently of the CPU Operating Systems Both c and d Neither a and b 9. d. b. b. an originator or receiver of data is usually designated by a. b. d.

c. Scrambling Structured Programming Micro Programming Sub Programming 17. d. Pseudocode Spaghetti Complex Code Object Code 16. b. d. which emphasizes breaking large and complex tasks into successively smaller sections? a. Super duplex Simplex Half duplex Full duplex . both A and b are true both A and B are false Only A is true Only B is true Who invented the GOTO instruction that tells a computer to jump backwards or forwards in its program a. c. d. a. Privacy of data The simplicity of data The validity of data The security of data 18. b. a. b. Structured English is easier to convert to program code than regular narrative English. b. b. d. c.B. Charles Babbage Ada Augusta Byron JM Jackguard Grace Murray Hooper 15. c. 14. Data integrity refers to a. c. c. b. d. Which data communication method is used for sending data in both directions at the same time. What is the name of the program coding that is unnecessarily complex and difficult to follow a. d. What is the name of the programming technique.

postal mail services telephone lines radio signals all the above 22. 6 9 8 7 20. c. The systematic access of small computers in a distributed data processing system is referred to as a. b. d.AT. d. c. d. c. modems computer ports interfaces buffer memory 21. c. b. The channel in the data communication model can be a. In the IBM PC . b. c. What do the words AT stand for a. Simultaneous execution of Program instructions from two applications Concurrent processing of two or more programs Multiple CPU’s\ All the above 24. A characteristic of a multi programming system is a b.19. dialed service multiplexing polling conversational mode 23. d. c. Additional Terminal Advance Technologies Applied Technologies Advanced terminology . The transfer of data from a CPU to peripheral devices of a computer is achieved through a. b. d. What is the usual number of bits transmitted simultaneously in parallel data transmission used by microcomputers? a. d. b.

b.25. b. d. Which of the following terms is the most closely related to main memory? a. d. d. ROM RAM PROM EEPROM 30. What are these lines called? a. d. b. d. nonvolatile permanent control unit temporary 28. c. Fields are composed of bytes Fields are composed of characters Records are composed of fields All the above 29 Which of the following hardware component is most volatile? a. Conductors Buses Connectors Connectivity 26. d. c. Different components on the motherboard of a PC processor unit are linked together by sets of parallel electrical conducting lines. Execution of instructions from different and independent programs by a computer at the same instant time is called a. Which of the following are true? a. Multiprogramming Multiprocessing Concurrent Programming Multitasking 27. c. b. b. Data bus capacity Addressing scheme Register size All the above . c. c. c. Which of the following affects the processing power? a. b.

31 An integrated circuit is a. d. A byte is a. c. c. 10 gigabytes of main memory 10 gigabytes of section memory 10 gigabytes of Virtual memory All the above 8 bits 4 bits 16 bits 32 bits 37. programmer skill language availability program compatibility with other software all the above 35. c. b. c. b. 10 GB HD space refers to a. assembler object computer machine 34 A factor in the section of source language is a. d. Which of the following is not transmission medium a. b. a complicated circuit an integrating device much costlier than single transistor fabricated in a single silicon chip 32 Data processing is a. b. c. b. Telephone lines Coaxial cables Modem Microwave systems 36. d. d. d. b. c. The same thing as data collection Similar to computer programming Mostly associated with commercial network Akin to data coding 33 A program written in machine language is called as ___________ program a. . b. c. d. d.

d. b. c. If you have a 64 kbps Internet line. Unix is a. d. FIFO list LIFO list Linear list Circular list 41. it means that your maximum data transfer rate is a. c. An inverted tree Is a one-d list of all files in the system Contain a list of all users of the system All the above . b. 64 X 1000 bits per sec 64 X 1024 bits/sec 64 X 1000 bytes/sec 64 X 1024 bytes/sec 39. b.38. b. d. c. A directory is organized as a. A stack is a a. Multi-user OS Multi-user and Multitasking OS Multitasking OS Batch OS 40. d. c.

.

e. .

Sign up to vote on this title
UsefulNot useful