C Language Exam 1

40 Questions  I  By Sudha_test on January 11, 2010
This is a sample C test

  

Question Excerpt

Removing question excerpt is a premium feature

Upgrade and get a lot more done!
1.  Identify the loop construct:
A.
B.
C.
D.
2.  Which of the following is not a storage class
A.
B.
C.
D.
3.  Which of the following is a correct way of defining a symbolic constant pie in C
A.
B.
C.
D.
4.  The minimum number of times the for loop is executed is
A.
B.
C.
D.
5.  In switch statement
A.
B.
C.
D.
6.  How many while statements are possible in do.... While loop?
A.
B.
C.
D.
7.  The storage area for register variables
A.
B.
C.
D.
8.  Which of the following statements is false
A.
B.
C.
D.
9.  Consider the segment If(1) printf(“yes”); else printf(“no”); what will be the output
A.
B.
C.
D.
10.  The global variable can be declared
A.
B.
C.
D.
11.  Which of the following is not correct
A.
B.
C.
D.
12.  printf (“\ “ well done\” ”); what will be the output of this statement
A.
B.
C.
D.
13.  What is the output of the following program main() {static int y; printf (“%d\n”, y); }
A.
B.
C.
D.
14.  The number of elements in array declaration
A.
B.
C.
D.
15.  In C every variable has
A.
B.
C.
D.
16.  All the elements in the array must be
A.
B.
C.
D.
17.  How many bytes will be allotted for the declaration int num[4] [3]
A.
B.
C.
D.
18.  If statement is a —————statement
A.
B.
C.
D.
19.  The total memory required for an array
A.
B.
C.
D.
20.  int table [2][3] ={{0}, {0}} in this statement
A.
B.
C.
D.
21.  The statements that prints out the character set from A-Z is, where a is an integer variable
A.
B.
C.
D.
22.  The amount of storage required for holding elements of the array depends on
A.
B.
C.
D.
23.  If we don’t initialize a static array, what will be the elements set to:
A.
B.
C.
D.
24.  What is wrong with the following program main() { char m1[9]= “message1”; char m2[9]=“message2”; m2=m1; printf(“msg is %s”,m2); }
A.
B.
C.
D.
25.  Array subscripts in ‘C’ always start at
A.
B.
C.
D.
26.  The maximum number of dimension an array can have in C language is
A.
B.
C.
D.
27.  What is the result of the expression ( 10/3 )*3+5%3 ?
A.
B.
C.
D.
28.  Output of the below program #include<stdio.h> main() {int a,b=0; int c[10]={1,2,3,4,5,6,7,8,9,0 }; for(a=0;a<10;++a) b+=c[a]; printf(“%d”,b); }
A.
B.
C.
D.
29.  consider the array definition int num [10] = { 3 ,3 ,3 }; pick the correct answers
A.
B.
C.
D.
30.  Which of the follwing is a string
A.
B.
C.
D.
31.  Give the output of the following program: #include < stdio.h > main() {int I=1; while (I < 5) {printf(“%d”, I); }} /* End of Main */
A.
B.
C.
D.
32.  How would you copy the name “Hello” to a character array (i.e. string) declared as char str[10];
A.
B.
C.
D.
33.  count=0; for ( I=0;I<=10; I++) {if(I%2==0) count++; }printf(“%d”, count); Pick out the correct value for count
A.
B.
C.
D.
34.  What will happen if you try to put so many values into an array during the initalization such that its size is  exceeded
A.
B.
C.
D.
35.  Compute the result of the following expression in ‘C’. A=3*4/5+10/5+8-1+7/8
A.
B.
C.
D.
36.  Which of the following statements would read a single character from the keyboard and place the result in a character variable ‘ch’ defined as: char ch;
A.
B.
C.
D.
37.  What is the output of the following module sum=0; I=0; do{ sum+=I; I++; }while(I<=5); printf(“%d”, sum);
A.
B.
C.
D.
38.  The value within the [] brackets in an array declaration specifies
A.
B.
C.
D.
39.  Dynamic memory allocation in array results in
A.
B.
C.
D.
40.  main() { char name[5]; scanf(“%s”,name); printf(“%s”, name); }if Program is the given as input, what will be the o/p of the program;
A.
B.
C.
D.
Back to top


to post comments.

Removing ad is a premium feature

Upgrade and get a lot more done!
Take Another Quiz