SlideShare una empresa de Scribd logo
1 de 22
Descargar para leer sin conexión
C Multiple Choice Questions and answers MCQ with Ans.
1. Who is father of C Language?
A. Bjarne Stroustrup
B. Dennis Ritchie
C. James A. Gosling
D. Dr. E.F. Codd
Answer : B
2. C Language developed at _____?
A. AT & T's Bell Laboratories of USA in 1972
B. AT & T's Bell Laboratories of USA in 1970
C. Sun Microsystems in 1973
D. Cambridge University in 1972
Answer : A
3. For 16-bit compiler allowable range for integer constants is ______ ?
A. -3.4e38 to 3.4e38
B. -32767 to 32768
C. -32768 to 32767
D. -32668 to 32667
Answer : C
4. C programs are converted into machine language with the help of
A. An Editor
B. A compiler
C. An operating system
D. None of the above
Answer : B
5. A C variable cannot start with
A. An alphabet
B. A number
C. A special symbol other than underscore
D. both (b) and (c)
Answer : D
6. Which of the following is allowed in a C Arithmetic instruction
A. []
B. {}
C. ()
D. None of the above
Answer : C
7. Which of the following shows the correct hierarchy of arithmetic operations in C
A. / + * -
B. * - / +
C. + - / *
D. * / + -
Answer : D
8. What is an array?
A. An array is a collection of variables that are of the dissimilar data type.
B. An array is a collection of variables that are of the same data type.
C. An array is not a collection of variables that are of the same data type.
D. None of the above.
Answer : B
9. What is right way to Initialization array?
A. int num[6] = { 2, 4, 12, 5, 45, 5 } ;
B. int n{} = { 2, 4, 12, 5, 45, 5 } ;
C. int n{6} = { 2, 4, 12 } ;
D. int n(6) = { 2, 4, 12, 5, 45, 5 } ;
Answer : A
10. An array elements are always stored in _________ memory locations.
A. Sequential
B. Random
C. Sequential and Random
D. None of the above
Answer : A
11. What is the right way to access value of structure variable book{ price, page }?
A. printf("%d%d", book.price, book.page);
B. printf("%d%d", price.book, page.book);
C. printf("%d%d", price::book, page::book);
D. printf("%d%d", price->book, page->book);
Answer : A
12. perror( ) function used to ?
A. Work same as printf()
B. prints the error message specified by the compiler
C. prints the garbage value assigned by the compiler
D. None of the above
Answer : B
13. Bitwise operators can operate upon?
A. double and chars
B. floats and doubles
C. ints and floats
D. ints and chars
Answer : D
14. What is C Tokens?
A. The smallest individual units of c program
B. The basic element recognized by the compiler
C. The largest individual units of program
D. A & B Both
Answer : D
15. What is Keywords?
A. Keywords have some predefine meanings and these meanings can be changed.
B. Keywords have some unknown meanings and these meanings cannot be changed.
C. Keywords have some predefine meanings and these meanings cannot be changed.
D. None of the above
Answer : C
16. What is constant?
A. Constants have fixed values that do not change during the execution of a program
B. Constants have fixed values that change during the execution of a program
C. Constants have unknown values that may be change during the execution of a program
D. None of the above
Answer : A
17. Which is the right way to declare constant in C?
A. int constant var =10;
B. int const var = 10;
C. const int var = 10;
D. B & C Both
Answer : D
18. Which operators are known as Ternary Operator?
A. ::, ?
B. ?, :
C. ?, ;;
D. None of the above
Answer : B
19. In switch statement, each case instance value must be _______?
A. Constant
B. Variable
C. Special Symbol
D. None of the above
Answer : A
20. What is the work of break keyword?
A. Halt execution of program
B. Restart execution of program
C. Exit from loop or switch statement
D. None of the above
Answer : C
21. What is function?
A. Function is a block of statements that perform some specific task.
B. Function is the fundamental modular unit. A function is usually designed to perform a specific
task.
C. Function is a block of code that performs a specific task. It has a name and it is reusable
D. All the above
Answer : D
22. Which one of the following sentences is true ?
A. The body of a while loop is executed at least once.
B. The body of a do ... while loop is executed at least once.
C. The body of a do ... while loop is executed zero or more times.
D. A for loop can never be used in place of a while loop.
Answer : B
23. A binary tree with 27 nodes has _______ null branches.
A. 54
B. 27
C. 26
D. None of the above
Answer : D
24. Which one of the following is not a linear data structure?
A. Array
B. Binary Tree
C. Queue
D. Stack
Answer : B
25. Recursive functions are executed in a?
A. First In First Out Order
B. Load Balancing
C. Parallel Fashion
D. Last In First Out Order
Answer : D
26. Queue is a _____________ list.
A. LIFO
B. LILO
C. FILO
D. FIFO
Answer : D
27. The statement print f ("%d", 10 ? 0 ? 5 : 1 : 12); will print?
A. 10
B. 0
C. 12
D. 1
Answer : D
28. To represent hierarchical relationship between elements, which data structure is suitable?
A. Priority
B. Tree
C. Dqueue
D. All of the above
Answer : B
29. Which of the following data structure is linear type?
A. Strings
B. Queue
C. Lists
D. All of the above
Answer : D
30. The statement printf("%c", 100); will print?
A. prints 100
B. print garbage
C. prints ASCII equivalent of 100
D. None of the above
Answer : C
31. The _______ memory allocation function modifies the previous allocated space.
A. calloc
B. free
C. malloc
D. realloc
Answer : D
32. Number of binary trees formed with 5 nodes are
A. 30
B. 36
C. 108
D. 42
Answer : D
33. The "C" language is
A. Context free language
B. Context sensitive language
C. Regular language
D. None of the above
Answer : A
34. The worst case time complexity of AVL tree is better in comparison to binary search tree for
A. Search and Insert Operations
B. Search and Delete Operations
C. Insert and Delete Operations
D. Search, Insert and Delete Operations
Answer : D
35. In which tree, for every node the height of its left subtree and right subtree differ almost by
one?
A. Binary search tree
B. AVL tree
C. Threaded Binary Tree
D. Complete Binary Tree
Answer : B
36. C is ______ Language?
A. Low Level
B. High Level
C. Assembly Level
D. Machine Level
37. The Default Parameter Passing Mechanism is called as
A. Call by Value
B. Call by Reference
C. Call by Address
D. Call by Name
Answer : A
38. What is Dequeue?
A. Elements can be added from front
B. Elements can be added to or removed from either the front or rear
C. Elements can be added from rear
D. None of the above
Answer : B
39. In which linked list last node address is null?
A. Doubly linked list
B. Circular list
C. Singly linked list
D. None of the above
Answer : C
40. Which is the correct syntax to declare constant pointer?
A. int *const constPtr;
B. *int constant constPtr;
C. const int *constPtr;
D. A and C both
Answer : D
More C Language Multiple Choice Questions: Click Here
1. 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
2. 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
3. What will be the output of the following statement ?
printf("%X%x%ci%x",11,10,'s',12);
a) error
b) basc
c) Bas94c
d) none of these
Ans: b
4. 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
5. 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
6. What will be output if you will compile and execute the following c code?
struct marks{
int p:3;
int c:3;
int m:2;
};
void main(){
struct marks s={2,-6,5};
printf("%d %d %d",s.p,s.c,s.m);
}
(a) 2 -6 5
(b) 2 -6 1
(c) 2 2 1
(d) Compiler error
(e) None of these
Ans: c
7. What will be the output of the following statements ?
int x[4] = {1,2,3}; printf("%d %d %D",x[3],x[2],x[1]);
a) 03%D
b) 000
c) 032
d) 321
Ans: c
8. What will be the output of the following statement ?
printf( 3 + "goodbye");
a) goodbye
b) odbye
c) bye
d) dbye
Ans: d
9. What will be the output of the following statements ?
long int a = scanf("%ld%ld",&a,&a); printf("%ld",a);
a) error
b) garbage value
c) 0
d) 2
Ans: b
10. What will be the output of the following program ?
#include
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
11. What will be the output of the following statements ?
int i = 1,j; j=i--- -2; printf("%d",j);
a) error
b) 2
c) 3
d) -3
Ans: c
12. What will be the output of following program ?
#include
main()
{
int x,y = 10;
x = y * NULL;
printf("%d",x);
}
a) error
b) 0
c) 10
d) garbage value
Ans: b
13. What will be the output of following statements ?
char x[ ] = "hello hi"; printf("%d%d",sizeof(*x),sizeof(x));
a) 88
b) 18
c) 29
d) 19
Ans: d
14. What will be the output of the following statements ?
int a=5,b=6,c=9,d; d=(ac?1:2):(c>b?6:8)); printf("%d",d);
a) 1
b) 2
c) 6
d) Error
Ans: d
15. 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
Ans: b
16. What will be the output of the following program ?
#include
void main()
{
int a = 36, b = 9;
printf("%d",a>>a/b-2);
}
a) 9
b) 7
c) 5
d) none of these
Ans: a
17. int testarray[3][2][2] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
What value does testarray[2][1][0] in the sample code above contain?
a) 11
b) 7
c) 5
d) 9
Ans: a
18. void main()
{
int a=10,b=20;
char x=1,y=0;
if(a,b,x,y)
{
printf("EXAM");
}
}
What is the output?
a) XAM is printed
b) exam is printed
c) Compiler Error
d) Nothing is printed
Ans: d
19. What is the output of the following code?
#include
void main()
{
int s=0;
while(s++<10)>
# define a 10
main()
{
printf("%d..",a);
foo();
printf("%d",a);
}
void foo()
{
#undef a
#define a 50
}
a) 10..10
b) 10..50
c) Error
d) 0
Ans: c
20. main()
{
struct
{
int i;
}xyz;
(*xyz)->i=10;
printf("%d",xyz.i);
}
What is the output of this program?
a) program will not compile
b) 10
c) god only knows
d) address of I
Ans: b
21.What will happen if in a C program you assign a value to an array element whose subscript exceeds
the size of array?
A. The element will be set to 0.
B. The compiler would report an error.
C. The program may crash if some important data gets overwritten.
D. The array size would appropriately grow.
Ans: C
22. What would be the output of the following program?
#include
main()
{
char str[]="S065AB";
printf("n%d", sizeof(str));
}
a) 7
b) 6
c) 5
d) error
Ans: b
23. What will be the value of `a` after the following code is executed
#define square(x) x*x
a = square(2+3)
a) 25
b) 13
c) 11
d) 10
Ans: c
24. #include
void func()
{
int x = 0;
static int y = 0;
x++; y++;
printf( "%d -- %dn", x, y );
}
int main()
{
func();
func();
return 0;
}
What will the code above print when it is executed?
a)
1 -- 1
1 -- 1
b)
1 -- 1
2 -- 1
c)
1 -- 1
2 -- 2
d)
1 -- 1
1 -- 2
Ans: d
25. long factorial (long x)
{
????
return x * factorial(x - 1);
}
With what do you replace the ???? to make the function shown above return the correct answer?
a)
if (x == 0) return 0;
b)
return 1;
c)
if (x >= 2) return 2;
d)
if (x <= 1) return 1;
Ans: d
26. int y[4] = {6, 7, 8, 9};
int *ptr = y + 2; printf("%dn", ptr[ 1 ] );
What is printed when the sample code above is executed?
a) 6
b) 7
c) 8
d) 9
Ans: d
27. int i = 4;
switch (i)
{
default: ;
case 3:
i += 5;
if ( i == 8)
{
i++;
if (i == 9) break;
i *= 2;
}
i -= 4;
break;
case 8:
i += 5;
break;
}
printf("i = %dn", i);
What will the output of the sample code above be?
a) i = 5
b) i = 8
c) i = 9
d) i = 10
Ans: a
28. What will be output if you will compile and execute the following c code?
void main()
{
if(printf("cquestionbank"))
printf("I know c");
else
printf("I know c++");
}
(a) I know c
(b) I know c++
(c) cquestionbankI know c
(d) cquestionbankI know c++
(e) Compiler error
Answer: (c)
29.What will be output if you will compile and execute the following c code?
#define call(x) #x
void main(){
printf("%s",call(c/c++));
}
(a)c
(b)c++
(c)#c/c++
(d)c/c++
(e)Compiler error
Answer: (d)
30. What will be output if you will compile and execute the following c code?
#define message "union is
power of c"
void main()
{
clrscr();
printf("%s",message);
getch();
}
(a) union is power of c
(b) union is power of c
(c) union is Power of c
(d) Compiler error
(e) None of these
Answer: (b)
31. What will be output if you will compile and execute the following c code?
void main(){
int a=25;
clrscr();
printf("%o %x",a,a);
getch();
}
(a) 25 25
(b) 025 0x25
(c) 12 42
(d) 31 19
(e) None of these
Answer: (d)
32. What will be output if you will compile and execute the following c code?
void main()
{
int i=0;
if(i==0){
i=((5,(i=3)),i=1);
printf("%d",i);
}
else
printf("equal");
}
(a) 5
(b) 3
(c) 1
(d) equal
(e) None of above
Answer: (c)
33.What will be output if you will compile and execute the following c code?
int extern x;
void main()
printf("%d",x);
x=2;
getch();
}
int x=23;
(a) 0
(b) 2
(c) 23
(d) Compiler error
(e) None of these
Answer: (c)
34.What will be output if you will compile and execute the following c code?
void main(){
int a,b;
a=1,3,15;
b=(2,4,6);
clrscr();
printf("%d ",a+b);
getch();
}
(a) 3
(b) 21
(c) 17
(d) 7
(e) Compiler error
Answer: (d)
35.What will be output if you will compile and execute the following c code?
void main(){
static main;
int x;
x=call(main);
clrscr();
printf("%d ",x);
getch();
}
int call(int address){
address++;
return address;
}
(a) 0
(b) 1
(c) Garbage value
(d) Compiler error
(e) None of these
Answer: (b)
36. What will be output if you will compile and execute the following c code?
#include "string.h"
void main(){
clrscr();
printf("%d %d",sizeof("string"),strlen("string"));
getch();
}
(a) 6 6
(b) 7 7
(c) 6 7
(d) 7 6
(e) None of these
Answer: (d)
37. Write c program which display mouse pointer and position of pointer.(In x coordinate, y
coordinate)?
Answer:
#include”dos.h”
#include”stdio.h”
void main()
{
union REGS i,o;
int x,y,k;
//show mouse pointer
i.x.ax=1;
int86(0x33,&i,&o);
while(!kbhit()) //its value will false when we hit key in the key board
{
i.x.ax=3; //get mouse position
x=o.x.cx;
y=o.x.dx;
clrscr();
printf("(%d , %d)",x,y);
delay(250);
int86(0x33,&i,&o);
}
getch();
}
38.What will be output if you will compile and execute the following c code?
void main(){
int huge*p=(int huge*)0XC0563331;
int huge*q=(int huge*)0xC2551341;
*p=200;
printf("%d",*q);
}
(a)0
(b)Garbage value
(c)null
(d) 200
(e)Compiler error
Answer: (d)
39.What will be output if you will compile and execute the following c code?
struct marks{
int p:3;
int c:3;
int m:2;
};
void main(){
struct marks s={2,-6,5};
printf("%d %d %d",s.p,s.c,s.m);
}
(a) 2 -6 5
(b) 2 -6 1
(c) 2 2 1
(d) Compiler error
(e) None of these
Answer: (c)
40.What will be output if you will compile and execute the following c code?
void main(){
if(printf("cquestionbank"))
printf("I know c");
else
printf("I know c++");
}
(a) I know c
(b) I know c++
(c) cquestionbankI know c
(d) cquestionbankI know c++
(e) Compiler error
Answer: (c)
41.What will be output if you will compile and execute the following c code?
#define call(x) #x
void main(){
printf("%s",call(c/c++));
}
(a)c
(b)c++
(c)#c/c++
(d)c/c++
(e)Compiler error
Answer: (d)
42. What will be output if you will compile and execute the following c code?
#define message "union is
power of c"
void main(){
clrscr();
printf("%s",message);
getch();
}
(a) union is power of c
(b) union ispower of c
(c) union is
Power of c
(d) Compiler error
(e) None of these
Answer: (b)
43. What will be output if you will compile and execute the following c code?
void main(){
int a=25;
clrscr();
printf("%o %x",a,a);
getch();
}
(a) 25 25
(b) 025 0x25
(c) 12 42
(d) 31 19
(e) None of these
Answer: (d)
44. What will be output if you will compile and execute the following c code?
void main(){
int i=0;
if(i==0){
i=((5,(i=3)),i=1);
printf("%d",i);
}
else
printf("equal");
}
(a) 5
(b) 3
(c) 1
(d) equal
(e) None of above
Answer: (c)
45.What will be output if you will compile and execute the following c code?
int extern x;
void main()
printf("%d",x);
x=2;
getch();
}
int x=23;
(a) 0
(b) 2
(c) 23
(d) Compiler error
(e) None of these
Answer: (c)
46.What will be output if you will compile and execute the following c code?
void main(){
int a,b;
a=1,3,15;
b=(2,4,6);
clrscr();
printf("%d ",a+b);
getch();
}
(a) 3
(b) 21
(c) 17
(d) 7
(e) Compiler error
Answer: (d)
47.What will be output if you will compile and execute the following c code?
void main(){
static main;
int x;
x=call(main);
clrscr();
printf("%d ",x);
getch();
}
int call(int address){
address++;
return address;
}
(a) 0
(b) 1
(c) Garbage value
(d) Compiler error
(e) None of these
Answer: (b)
48.What will be output if you will compile and execute the following c code?
#include "string.h"
void main(){
clrscr();
printf("%d %d",sizeof("string"),strlen("string"));
getch();
}
(a) 6 6
(b) 7 7
(c) 6 7
(d) 7 6
(e) None of these
Answer: (d)
49.What will be output if you will compile and execute the following c code?
void main(){
int huge*p=(int huge*)0XC0563331;
int huge*q=(int huge*)0xC2551341;
*p=200;
printf("%d",*q);
}
(a)0
(b)Garbage value
(c)null
(d) 200
(e)Compiler error
Answer: (d)
50.What will be output if you will compile and execute the following c code?
struct marks{
int p:3;
int c:3;
int m:2;
};
void main(){
struct marks s={2,-6,5};
printf("%d %d %d",s.p,s.c,s.m);
}
(a) 2 -6 5
(b) 2 -6 1
(c) 2 2 1
(d) Compiler error
(e) None of these
Answer: (c)
51.What will be output if you will compile and execute the following c code?
void main(){
if(printf("cquestionbank"))
printf("I know c");
else
printf("I know c++");
}
(a) I know c
(b) I know c++
(c) cquestionbankI know c
(d) cquestionbankI know c++
(e) Compiler error
Answer: (c)
52.What will be output if you will compile and execute the following c code?
#define call(x) #x
void main(){
printf("%s",call(c/c++));
}
(a)c
(b)c++
(c)#c/c++
(d)c/c++
(e)Compiler error
Answer: (d)
53. What will be output if you will compile and execute the following c code?
#define message "union is
power of c"
void main(){
clrscr();
printf("%s",message);
getch();
}
(a) union is power of c
(b) union ispower of c
(c) union is
Power of c
(d) Compiler error
(e) None of these
Answer: (b)
54. What will be output if you will compile and execute the following c code?
void main(){
int a=25;
clrscr();
printf("%o %x",a,a);
getch();
}
(a) 25 25
(b) 025 0x25
(c) 12 42
(d) 31 19
(e) None of these
Answer: (d)
55.What will be output if you will compile and execute the following c code?
void main(){
int i=0;
if(i==0){
i=((5,(i=3)),i=1);
printf("%d",i);
}
else
printf("equal");
}
(a) 5
(b) 3
(c) 1
(d) equal
(e) None of above
Answer: (c)
56.What will be output if you will compile and execute the following c code?
int extern x;
void main()
printf("%d",x);
x=2;
getch();
}
int x=23;
(a) 0
(b) 2
(c) 23
(d) Compiler error
(e) None of these
Answer: (c)
57.What will be output if you will compile and execute the following c code?
void main(){
int a,b;
a=1,3,15;
b=(2,4,6);
clrscr();
printf("%d ",a+b);
getch();
}
(a) 3
(b) 21
(c) 17
(d) 7
(e) Compiler error
Answer: (d)
58.What will be output if you will compile and execute the following c code?
void main(){
static main;
int x;
x=call(main);
clrscr();
printf("%d ",x);
getch();
}
int call(int address){
address++;
return address;
}
(a) 0
(b) 1
(c) Garbage value
(d) Compiler error
(e) None of these
Answer: (b)
59.What will be output if you will compile and execute the following c code?
#include "string.h"
void main(){
clrscr();
printf("%d %d",sizeof("string"),strlen("string"));
getch();
}
(a) 6 6
(b) 7 7
(c) 6 7
(d) 7 6
(e) None of these
Answer: (d)
60.What will be output if you will compile and execute the following c code?
void main(){
int huge*p=(int huge*)0XC0563331;
int huge*q=(int huge*)0xC2551341;
*p=200;
printf("%d",*q);
}
(a)0
(b)Garbage value
(c)null
(d) 200
(e)Compiler error
Answer: (d)
61. What is the right way to access value of structure variable book{ price, page }?
A. printf("%d%d", book.price, book.page);
B. printf("%d%d", price.book, page.book);
C. printf("%d%d", price::book, page::book);
D. printf("%d%d", price->book, page->book);
Answer : A
62. perror( ) function used to ?
A. Work same as printf()
B. prints the error message specified by the compiler
C. prints the garbage value assigned by the compiler
D. None of the above
Answer : B
63. Bitwise operators can operate upon?
A. double and chars
B. floats and doubles
C. ints and floats
D. ints and chars
Answer : D
64. What is C Tokens?
A. The smallest individual units of c program
B. The basic element recognized by the compiler
C. The largest individual units of program
D. A & B Both
Answer : D
65. What is Keywords?
A. Keywords have some predefine meanings and these meanings can be changed.
B. Keywords have some unknown meanings and these meanings cannot be changed.
C. Keywords have some predefine meanings and these meanings cannot be changed.
D. None of the above
Answer : C
66. What is constant?
A. Constants have fixed values that do not change during the execution of a program
B. Constants have fixed values that change during the execution of a program
C. Constants have unknown values that may be change during the execution of a program
D. None of the above
Answer : A
67. Which is the right way to declare constant in C?
A. int constant var =10;
B. int const var = 10;
C. const int var = 10;
D. B & C Both
Answer : D
68. Which operators are known as Ternary Operator?
A. ::, ?
B. ?, :
C. ?, ;;
D. None of the avobe
Answer : B
69. In switch statement, each case instance value must be _______?
A. Constant
B. Variable
C. Special Symbol
D. None of the avobe
Answer : A
70. What is the work of break keyword?
A. Halt execution of program
B. Restart execution of program
C. Exit from loop or switch statement
D. None of the avobe
Answer : C

Más contenido relacionado

La actualidad más candente

Cs2303 theory of computation all anna University question papers
Cs2303 theory of computation all anna University question papersCs2303 theory of computation all anna University question papers
Cs2303 theory of computation all anna University question papersappasami
 
OOP in C++
OOP in C++OOP in C++
OOP in C++ppd1961
 
CDAC CCAT examination important question
CDAC CCAT examination important questionCDAC CCAT examination important question
CDAC CCAT examination important questionprabhatjon
 
introduction to c language
 introduction to c language introduction to c language
introduction to c languageRai University
 
Chapter 5 Balagurusamy Programming ANSI in c
Chapter 5 Balagurusamy Programming ANSI  in cChapter 5 Balagurusamy Programming ANSI  in c
Chapter 5 Balagurusamy Programming ANSI in cBUBT
 
Hierarchical inheritance
Hierarchical inheritanceHierarchical inheritance
Hierarchical inheritanceShrija Madhu
 
Templates in C++
Templates in C++Templates in C++
Templates in C++Tech_MX
 
Chp6 assembly language programming for pic copy
Chp6 assembly language programming for pic   copyChp6 assembly language programming for pic   copy
Chp6 assembly language programming for pic copymkazree
 
Circuit complexity
Circuit complexityCircuit complexity
Circuit complexityAmi Prakash
 
Fractional Knapsack Problem
Fractional Knapsack ProblemFractional Knapsack Problem
Fractional Knapsack Problemharsh kothari
 
Types of c operators ppt
Types of c operators pptTypes of c operators ppt
Types of c operators pptViraj Shah
 
Webinar : P, NP, NP-Hard , NP - Complete problems
Webinar : P, NP, NP-Hard , NP - Complete problems Webinar : P, NP, NP-Hard , NP - Complete problems
Webinar : P, NP, NP-Hard , NP - Complete problems Ziyauddin Shaik
 
Assembly Language Lecture 3
Assembly Language Lecture 3Assembly Language Lecture 3
Assembly Language Lecture 3Motaz Saad
 
Graph coloring problem(DAA).pptx
Graph coloring problem(DAA).pptxGraph coloring problem(DAA).pptx
Graph coloring problem(DAA).pptxHome
 
Huffman Coding Algorithm Presentation
Huffman Coding Algorithm PresentationHuffman Coding Algorithm Presentation
Huffman Coding Algorithm PresentationAkm Monir
 
operator overloading & type conversion in cpp
operator overloading & type conversion in cppoperator overloading & type conversion in cpp
operator overloading & type conversion in cppgourav kottawar
 
C++ classes tutorials
C++ classes tutorialsC++ classes tutorials
C++ classes tutorialsMayank Jain
 
Inheritance in c++ by Manan Pasricha
Inheritance in c++ by Manan PasrichaInheritance in c++ by Manan Pasricha
Inheritance in c++ by Manan PasrichaMananPasricha
 

La actualidad más candente (20)

Cs2303 theory of computation all anna University question papers
Cs2303 theory of computation all anna University question papersCs2303 theory of computation all anna University question papers
Cs2303 theory of computation all anna University question papers
 
OOP in C++
OOP in C++OOP in C++
OOP in C++
 
CDAC CCAT examination important question
CDAC CCAT examination important questionCDAC CCAT examination important question
CDAC CCAT examination important question
 
introduction to c language
 introduction to c language introduction to c language
introduction to c language
 
Chapter 5 Balagurusamy Programming ANSI in c
Chapter 5 Balagurusamy Programming ANSI  in cChapter 5 Balagurusamy Programming ANSI  in c
Chapter 5 Balagurusamy Programming ANSI in c
 
Hierarchical inheritance
Hierarchical inheritanceHierarchical inheritance
Hierarchical inheritance
 
Templates in C++
Templates in C++Templates in C++
Templates in C++
 
Chp6 assembly language programming for pic copy
Chp6 assembly language programming for pic   copyChp6 assembly language programming for pic   copy
Chp6 assembly language programming for pic copy
 
Circuit complexity
Circuit complexityCircuit complexity
Circuit complexity
 
Fractional Knapsack Problem
Fractional Knapsack ProblemFractional Knapsack Problem
Fractional Knapsack Problem
 
Types of c operators ppt
Types of c operators pptTypes of c operators ppt
Types of c operators ppt
 
Webinar : P, NP, NP-Hard , NP - Complete problems
Webinar : P, NP, NP-Hard , NP - Complete problems Webinar : P, NP, NP-Hard , NP - Complete problems
Webinar : P, NP, NP-Hard , NP - Complete problems
 
Np hard
Np hardNp hard
Np hard
 
Assembly Language Lecture 3
Assembly Language Lecture 3Assembly Language Lecture 3
Assembly Language Lecture 3
 
Graph coloring problem(DAA).pptx
Graph coloring problem(DAA).pptxGraph coloring problem(DAA).pptx
Graph coloring problem(DAA).pptx
 
Programing techniques
Programing techniquesPrograming techniques
Programing techniques
 
Huffman Coding Algorithm Presentation
Huffman Coding Algorithm PresentationHuffman Coding Algorithm Presentation
Huffman Coding Algorithm Presentation
 
operator overloading & type conversion in cpp
operator overloading & type conversion in cppoperator overloading & type conversion in cpp
operator overloading & type conversion in cpp
 
C++ classes tutorials
C++ classes tutorialsC++ classes tutorials
C++ classes tutorials
 
Inheritance in c++ by Manan Pasricha
Inheritance in c++ by Manan PasrichaInheritance in c++ by Manan Pasricha
Inheritance in c++ by Manan Pasricha
 

Similar a Computer programming mcqs

Model question paper_mc0061
Model question paper_mc0061Model question paper_mc0061
Model question paper_mc0061gurbaxrawat
 
this pdf very much useful for embedded c programming students
this pdf very much useful for embedded c programming studentsthis pdf very much useful for embedded c programming students
this pdf very much useful for embedded c programming studentspavan81088
 
Data structures and algorithms unit i
Data structures and algorithms unit iData structures and algorithms unit i
Data structures and algorithms unit isonalisraisoni
 
important C questions and_answers praveensomesh
important C questions and_answers praveensomeshimportant C questions and_answers praveensomesh
important C questions and_answers praveensomeshpraveensomesh
 
(Www.entrance exam.net)-tcs placement sample paper 2
(Www.entrance exam.net)-tcs placement sample paper 2(Www.entrance exam.net)-tcs placement sample paper 2
(Www.entrance exam.net)-tcs placement sample paper 2Pamidimukkala Sivani
 
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2Knowledge Center Computer
 
ExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docxExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docxgitagrimston
 
Mcq+questions+cxc+it
Mcq+questions+cxc+itMcq+questions+cxc+it
Mcq+questions+cxc+itjimkana13
 
200 mcq c++(Ankit dubey)
200 mcq c++(Ankit dubey)200 mcq c++(Ankit dubey)
200 mcq c++(Ankit dubey)Ankit Dubey
 

Similar a Computer programming mcqs (20)

Technical questions
Technical questionsTechnical questions
Technical questions
 
Exam for c
Exam for cExam for c
Exam for c
 
C MCQ
C MCQC MCQ
C MCQ
 
Model question paper_mc0061
Model question paper_mc0061Model question paper_mc0061
Model question paper_mc0061
 
this pdf very much useful for embedded c programming students
this pdf very much useful for embedded c programming studentsthis pdf very much useful for embedded c programming students
this pdf very much useful for embedded c programming students
 
Data structures and algorithms unit i
Data structures and algorithms unit iData structures and algorithms unit i
Data structures and algorithms unit i
 
Soln dc05
Soln dc05Soln dc05
Soln dc05
 
important C questions and_answers praveensomesh
important C questions and_answers praveensomeshimportant C questions and_answers praveensomesh
important C questions and_answers praveensomesh
 
Computer Assembly MCQ
Computer Assembly MCQComputer Assembly MCQ
Computer Assembly MCQ
 
Part - 3 Cpp programming Solved MCQ
Part - 3 Cpp programming Solved MCQ  Part - 3 Cpp programming Solved MCQ
Part - 3 Cpp programming Solved MCQ
 
CSC Millionaire
CSC MillionaireCSC Millionaire
CSC Millionaire
 
(Www.entrance exam.net)-tcs placement sample paper 2
(Www.entrance exam.net)-tcs placement sample paper 2(Www.entrance exam.net)-tcs placement sample paper 2
(Www.entrance exam.net)-tcs placement sample paper 2
 
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
 
ExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docxExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docx
 
NET_Solved ans
NET_Solved ansNET_Solved ans
NET_Solved ans
 
Mcq+questions+cxc+it
Mcq+questions+cxc+itMcq+questions+cxc+it
Mcq+questions+cxc+it
 
200 mcq c++(Ankit dubey)
200 mcq c++(Ankit dubey)200 mcq c++(Ankit dubey)
200 mcq c++(Ankit dubey)
 
C++ questions
C++ questionsC++ questions
C++ questions
 
Part - 2 Cpp programming Solved MCQ
Part - 2  Cpp programming Solved MCQ Part - 2  Cpp programming Solved MCQ
Part - 2 Cpp programming Solved MCQ
 
C test
C testC test
C test
 

Último

Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...OnePlan Solutions
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingShane Coughlan
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesVictoriaMetrics
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencessuser9e7c64
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptxVinzoCenzo
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
SoftTeco - Software Development Company Profile
SoftTeco - Software Development Company ProfileSoftTeco - Software Development Company Profile
SoftTeco - Software Development Company Profileakrivarotava
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsJean Silva
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesKrzysztofKkol1
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 

Último (20)

Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 Updates
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conference
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptx
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
SoftTeco - Software Development Company Profile
SoftTeco - Software Development Company ProfileSoftTeco - Software Development Company Profile
SoftTeco - Software Development Company Profile
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero results
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 

Computer programming mcqs

  • 1. C Multiple Choice Questions and answers MCQ with Ans. 1. Who is father of C Language? A. Bjarne Stroustrup B. Dennis Ritchie C. James A. Gosling D. Dr. E.F. Codd Answer : B 2. C Language developed at _____? A. AT & T's Bell Laboratories of USA in 1972 B. AT & T's Bell Laboratories of USA in 1970 C. Sun Microsystems in 1973 D. Cambridge University in 1972 Answer : A 3. For 16-bit compiler allowable range for integer constants is ______ ? A. -3.4e38 to 3.4e38 B. -32767 to 32768 C. -32768 to 32767 D. -32668 to 32667 Answer : C 4. C programs are converted into machine language with the help of A. An Editor B. A compiler C. An operating system D. None of the above Answer : B 5. A C variable cannot start with A. An alphabet B. A number C. A special symbol other than underscore D. both (b) and (c) Answer : D 6. Which of the following is allowed in a C Arithmetic instruction A. [] B. {} C. () D. None of the above Answer : C 7. Which of the following shows the correct hierarchy of arithmetic operations in C A. / + * - B. * - / + C. + - / * D. * / + - Answer : D 8. What is an array? A. An array is a collection of variables that are of the dissimilar data type. B. An array is a collection of variables that are of the same data type. C. An array is not a collection of variables that are of the same data type.
  • 2. D. None of the above. Answer : B 9. What is right way to Initialization array? A. int num[6] = { 2, 4, 12, 5, 45, 5 } ; B. int n{} = { 2, 4, 12, 5, 45, 5 } ; C. int n{6} = { 2, 4, 12 } ; D. int n(6) = { 2, 4, 12, 5, 45, 5 } ; Answer : A 10. An array elements are always stored in _________ memory locations. A. Sequential B. Random C. Sequential and Random D. None of the above Answer : A 11. What is the right way to access value of structure variable book{ price, page }? A. printf("%d%d", book.price, book.page); B. printf("%d%d", price.book, page.book); C. printf("%d%d", price::book, page::book); D. printf("%d%d", price->book, page->book); Answer : A 12. perror( ) function used to ? A. Work same as printf() B. prints the error message specified by the compiler C. prints the garbage value assigned by the compiler D. None of the above Answer : B 13. Bitwise operators can operate upon? A. double and chars B. floats and doubles C. ints and floats D. ints and chars Answer : D 14. What is C Tokens? A. The smallest individual units of c program B. The basic element recognized by the compiler C. The largest individual units of program D. A & B Both Answer : D 15. What is Keywords? A. Keywords have some predefine meanings and these meanings can be changed. B. Keywords have some unknown meanings and these meanings cannot be changed. C. Keywords have some predefine meanings and these meanings cannot be changed. D. None of the above Answer : C 16. What is constant? A. Constants have fixed values that do not change during the execution of a program B. Constants have fixed values that change during the execution of a program C. Constants have unknown values that may be change during the execution of a program D. None of the above
  • 3. Answer : A 17. Which is the right way to declare constant in C? A. int constant var =10; B. int const var = 10; C. const int var = 10; D. B & C Both Answer : D 18. Which operators are known as Ternary Operator? A. ::, ? B. ?, : C. ?, ;; D. None of the above Answer : B 19. In switch statement, each case instance value must be _______? A. Constant B. Variable C. Special Symbol D. None of the above Answer : A 20. What is the work of break keyword? A. Halt execution of program B. Restart execution of program C. Exit from loop or switch statement D. None of the above Answer : C 21. What is function? A. Function is a block of statements that perform some specific task. B. Function is the fundamental modular unit. A function is usually designed to perform a specific task. C. Function is a block of code that performs a specific task. It has a name and it is reusable D. All the above Answer : D 22. Which one of the following sentences is true ? A. The body of a while loop is executed at least once. B. The body of a do ... while loop is executed at least once. C. The body of a do ... while loop is executed zero or more times. D. A for loop can never be used in place of a while loop. Answer : B 23. A binary tree with 27 nodes has _______ null branches. A. 54 B. 27 C. 26 D. None of the above Answer : D 24. Which one of the following is not a linear data structure? A. Array B. Binary Tree C. Queue D. Stack
  • 4. Answer : B 25. Recursive functions are executed in a? A. First In First Out Order B. Load Balancing C. Parallel Fashion D. Last In First Out Order Answer : D 26. Queue is a _____________ list. A. LIFO B. LILO C. FILO D. FIFO Answer : D 27. The statement print f ("%d", 10 ? 0 ? 5 : 1 : 12); will print? A. 10 B. 0 C. 12 D. 1 Answer : D 28. To represent hierarchical relationship between elements, which data structure is suitable? A. Priority B. Tree C. Dqueue D. All of the above Answer : B 29. Which of the following data structure is linear type? A. Strings B. Queue C. Lists D. All of the above Answer : D 30. The statement printf("%c", 100); will print? A. prints 100 B. print garbage C. prints ASCII equivalent of 100 D. None of the above Answer : C 31. The _______ memory allocation function modifies the previous allocated space. A. calloc B. free C. malloc D. realloc Answer : D 32. Number of binary trees formed with 5 nodes are A. 30 B. 36 C. 108 D. 42 Answer : D
  • 5. 33. The "C" language is A. Context free language B. Context sensitive language C. Regular language D. None of the above Answer : A 34. The worst case time complexity of AVL tree is better in comparison to binary search tree for A. Search and Insert Operations B. Search and Delete Operations C. Insert and Delete Operations D. Search, Insert and Delete Operations Answer : D 35. In which tree, for every node the height of its left subtree and right subtree differ almost by one? A. Binary search tree B. AVL tree C. Threaded Binary Tree D. Complete Binary Tree Answer : B 36. C is ______ Language? A. Low Level B. High Level C. Assembly Level D. Machine Level 37. The Default Parameter Passing Mechanism is called as A. Call by Value B. Call by Reference C. Call by Address D. Call by Name Answer : A 38. What is Dequeue? A. Elements can be added from front B. Elements can be added to or removed from either the front or rear C. Elements can be added from rear D. None of the above Answer : B 39. In which linked list last node address is null? A. Doubly linked list B. Circular list C. Singly linked list D. None of the above Answer : C 40. Which is the correct syntax to declare constant pointer? A. int *const constPtr; B. *int constant constPtr; C. const int *constPtr; D. A and C both Answer : D
  • 6. More C Language Multiple Choice Questions: Click Here 1. 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 2. 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 3. What will be the output of the following statement ? printf("%X%x%ci%x",11,10,'s',12); a) error b) basc c) Bas94c d) none of these Ans: b 4. 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 5. 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 6. What will be output if you will compile and execute the following c code? struct marks{ int p:3; int c:3; int m:2; }; void main(){ struct marks s={2,-6,5}; printf("%d %d %d",s.p,s.c,s.m); } (a) 2 -6 5 (b) 2 -6 1 (c) 2 2 1
  • 7. (d) Compiler error (e) None of these Ans: c 7. What will be the output of the following statements ? int x[4] = {1,2,3}; printf("%d %d %D",x[3],x[2],x[1]); a) 03%D b) 000 c) 032 d) 321 Ans: c 8. What will be the output of the following statement ? printf( 3 + "goodbye"); a) goodbye b) odbye c) bye d) dbye Ans: d 9. What will be the output of the following statements ? long int a = scanf("%ld%ld",&a,&a); printf("%ld",a); a) error b) garbage value c) 0 d) 2 Ans: b 10. What will be the output of the following program ? #include 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 11. What will be the output of the following statements ? int i = 1,j; j=i--- -2; printf("%d",j); a) error b) 2 c) 3 d) -3 Ans: c 12. What will be the output of following program ? #include
  • 8. main() { int x,y = 10; x = y * NULL; printf("%d",x); } a) error b) 0 c) 10 d) garbage value Ans: b 13. What will be the output of following statements ? char x[ ] = "hello hi"; printf("%d%d",sizeof(*x),sizeof(x)); a) 88 b) 18 c) 29 d) 19 Ans: d 14. What will be the output of the following statements ? int a=5,b=6,c=9,d; d=(ac?1:2):(c>b?6:8)); printf("%d",d); a) 1 b) 2 c) 6 d) Error Ans: d 15. 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 Ans: b 16. What will be the output of the following program ? #include void main() { int a = 36, b = 9; printf("%d",a>>a/b-2); } a) 9 b) 7 c) 5 d) none of these Ans: a 17. int testarray[3][2][2] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; What value does testarray[2][1][0] in the sample code above contain? a) 11 b) 7 c) 5 d) 9 Ans: a
  • 9. 18. void main() { int a=10,b=20; char x=1,y=0; if(a,b,x,y) { printf("EXAM"); } } What is the output? a) XAM is printed b) exam is printed c) Compiler Error d) Nothing is printed Ans: d 19. What is the output of the following code? #include void main() { int s=0; while(s++<10)> # define a 10 main() { printf("%d..",a); foo(); printf("%d",a); } void foo() { #undef a #define a 50 } a) 10..10 b) 10..50 c) Error d) 0 Ans: c 20. main() { struct { int i; }xyz; (*xyz)->i=10; printf("%d",xyz.i); } What is the output of this program? a) program will not compile b) 10 c) god only knows d) address of I Ans: b
  • 10. 21.What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array? A. The element will be set to 0. B. The compiler would report an error. C. The program may crash if some important data gets overwritten. D. The array size would appropriately grow. Ans: C 22. What would be the output of the following program? #include main() { char str[]="S065AB"; printf("n%d", sizeof(str)); } a) 7 b) 6 c) 5 d) error Ans: b 23. What will be the value of `a` after the following code is executed #define square(x) x*x a = square(2+3) a) 25 b) 13 c) 11 d) 10 Ans: c 24. #include void func() { int x = 0; static int y = 0; x++; y++; printf( "%d -- %dn", x, y ); } int main() { func(); func(); return 0; } What will the code above print when it is executed? a) 1 -- 1 1 -- 1 b) 1 -- 1 2 -- 1 c) 1 -- 1 2 -- 2 d) 1 -- 1 1 -- 2
  • 11. Ans: d 25. long factorial (long x) { ???? return x * factorial(x - 1); } With what do you replace the ???? to make the function shown above return the correct answer? a) if (x == 0) return 0; b) return 1; c) if (x >= 2) return 2; d) if (x <= 1) return 1; Ans: d 26. int y[4] = {6, 7, 8, 9}; int *ptr = y + 2; printf("%dn", ptr[ 1 ] ); What is printed when the sample code above is executed? a) 6 b) 7 c) 8 d) 9 Ans: d 27. int i = 4; switch (i) { default: ; case 3: i += 5; if ( i == 8) { i++; if (i == 9) break; i *= 2; } i -= 4; break; case 8: i += 5; break; } printf("i = %dn", i); What will the output of the sample code above be? a) i = 5 b) i = 8 c) i = 9 d) i = 10 Ans: a 28. What will be output if you will compile and execute the following c code? void main()
  • 12. { if(printf("cquestionbank")) printf("I know c"); else printf("I know c++"); } (a) I know c (b) I know c++ (c) cquestionbankI know c (d) cquestionbankI know c++ (e) Compiler error Answer: (c) 29.What will be output if you will compile and execute the following c code? #define call(x) #x void main(){ printf("%s",call(c/c++)); } (a)c (b)c++ (c)#c/c++ (d)c/c++ (e)Compiler error Answer: (d) 30. What will be output if you will compile and execute the following c code? #define message "union is power of c" void main() { clrscr(); printf("%s",message); getch(); } (a) union is power of c (b) union is power of c (c) union is Power of c (d) Compiler error (e) None of these Answer: (b) 31. What will be output if you will compile and execute the following c code? void main(){ int a=25; clrscr(); printf("%o %x",a,a); getch(); } (a) 25 25 (b) 025 0x25 (c) 12 42 (d) 31 19 (e) None of these Answer: (d) 32. What will be output if you will compile and execute the following c code? void main()
  • 13. { int i=0; if(i==0){ i=((5,(i=3)),i=1); printf("%d",i); } else printf("equal"); } (a) 5 (b) 3 (c) 1 (d) equal (e) None of above Answer: (c) 33.What will be output if you will compile and execute the following c code? int extern x; void main() printf("%d",x); x=2; getch(); } int x=23; (a) 0 (b) 2 (c) 23 (d) Compiler error (e) None of these Answer: (c) 34.What will be output if you will compile and execute the following c code? void main(){ int a,b; a=1,3,15; b=(2,4,6); clrscr(); printf("%d ",a+b); getch(); } (a) 3 (b) 21 (c) 17 (d) 7 (e) Compiler error Answer: (d) 35.What will be output if you will compile and execute the following c code? void main(){ static main; int x; x=call(main); clrscr(); printf("%d ",x); getch(); } int call(int address){
  • 14. address++; return address; } (a) 0 (b) 1 (c) Garbage value (d) Compiler error (e) None of these Answer: (b) 36. What will be output if you will compile and execute the following c code? #include "string.h" void main(){ clrscr(); printf("%d %d",sizeof("string"),strlen("string")); getch(); } (a) 6 6 (b) 7 7 (c) 6 7 (d) 7 6 (e) None of these Answer: (d) 37. Write c program which display mouse pointer and position of pointer.(In x coordinate, y coordinate)? Answer: #include”dos.h” #include”stdio.h” void main() { union REGS i,o; int x,y,k; //show mouse pointer i.x.ax=1; int86(0x33,&i,&o); while(!kbhit()) //its value will false when we hit key in the key board { i.x.ax=3; //get mouse position x=o.x.cx; y=o.x.dx; clrscr(); printf("(%d , %d)",x,y); delay(250); int86(0x33,&i,&o); } getch(); } 38.What will be output if you will compile and execute the following c code? void main(){ int huge*p=(int huge*)0XC0563331; int huge*q=(int huge*)0xC2551341; *p=200; printf("%d",*q); } (a)0
  • 15. (b)Garbage value (c)null (d) 200 (e)Compiler error Answer: (d) 39.What will be output if you will compile and execute the following c code? struct marks{ int p:3; int c:3; int m:2; }; void main(){ struct marks s={2,-6,5}; printf("%d %d %d",s.p,s.c,s.m); } (a) 2 -6 5 (b) 2 -6 1 (c) 2 2 1 (d) Compiler error (e) None of these Answer: (c) 40.What will be output if you will compile and execute the following c code? void main(){ if(printf("cquestionbank")) printf("I know c"); else printf("I know c++"); } (a) I know c (b) I know c++ (c) cquestionbankI know c (d) cquestionbankI know c++ (e) Compiler error Answer: (c) 41.What will be output if you will compile and execute the following c code? #define call(x) #x void main(){ printf("%s",call(c/c++)); } (a)c (b)c++ (c)#c/c++ (d)c/c++ (e)Compiler error Answer: (d) 42. What will be output if you will compile and execute the following c code? #define message "union is power of c" void main(){ clrscr(); printf("%s",message); getch(); }
  • 16. (a) union is power of c (b) union ispower of c (c) union is Power of c (d) Compiler error (e) None of these Answer: (b) 43. What will be output if you will compile and execute the following c code? void main(){ int a=25; clrscr(); printf("%o %x",a,a); getch(); } (a) 25 25 (b) 025 0x25 (c) 12 42 (d) 31 19 (e) None of these Answer: (d) 44. What will be output if you will compile and execute the following c code? void main(){ int i=0; if(i==0){ i=((5,(i=3)),i=1); printf("%d",i); } else printf("equal"); } (a) 5 (b) 3 (c) 1 (d) equal (e) None of above Answer: (c) 45.What will be output if you will compile and execute the following c code? int extern x; void main() printf("%d",x); x=2; getch(); } int x=23; (a) 0 (b) 2 (c) 23 (d) Compiler error (e) None of these Answer: (c) 46.What will be output if you will compile and execute the following c code? void main(){ int a,b;
  • 17. a=1,3,15; b=(2,4,6); clrscr(); printf("%d ",a+b); getch(); } (a) 3 (b) 21 (c) 17 (d) 7 (e) Compiler error Answer: (d) 47.What will be output if you will compile and execute the following c code? void main(){ static main; int x; x=call(main); clrscr(); printf("%d ",x); getch(); } int call(int address){ address++; return address; } (a) 0 (b) 1 (c) Garbage value (d) Compiler error (e) None of these Answer: (b) 48.What will be output if you will compile and execute the following c code? #include "string.h" void main(){ clrscr(); printf("%d %d",sizeof("string"),strlen("string")); getch(); } (a) 6 6 (b) 7 7 (c) 6 7 (d) 7 6 (e) None of these Answer: (d) 49.What will be output if you will compile and execute the following c code? void main(){ int huge*p=(int huge*)0XC0563331; int huge*q=(int huge*)0xC2551341; *p=200; printf("%d",*q); } (a)0 (b)Garbage value (c)null
  • 18. (d) 200 (e)Compiler error Answer: (d) 50.What will be output if you will compile and execute the following c code? struct marks{ int p:3; int c:3; int m:2; }; void main(){ struct marks s={2,-6,5}; printf("%d %d %d",s.p,s.c,s.m); } (a) 2 -6 5 (b) 2 -6 1 (c) 2 2 1 (d) Compiler error (e) None of these Answer: (c) 51.What will be output if you will compile and execute the following c code? void main(){ if(printf("cquestionbank")) printf("I know c"); else printf("I know c++"); } (a) I know c (b) I know c++ (c) cquestionbankI know c (d) cquestionbankI know c++ (e) Compiler error Answer: (c) 52.What will be output if you will compile and execute the following c code? #define call(x) #x void main(){ printf("%s",call(c/c++)); } (a)c (b)c++ (c)#c/c++ (d)c/c++ (e)Compiler error Answer: (d) 53. What will be output if you will compile and execute the following c code? #define message "union is power of c" void main(){ clrscr(); printf("%s",message); getch(); } (a) union is power of c (b) union ispower of c
  • 19. (c) union is Power of c (d) Compiler error (e) None of these Answer: (b) 54. What will be output if you will compile and execute the following c code? void main(){ int a=25; clrscr(); printf("%o %x",a,a); getch(); } (a) 25 25 (b) 025 0x25 (c) 12 42 (d) 31 19 (e) None of these Answer: (d) 55.What will be output if you will compile and execute the following c code? void main(){ int i=0; if(i==0){ i=((5,(i=3)),i=1); printf("%d",i); } else printf("equal"); } (a) 5 (b) 3 (c) 1 (d) equal (e) None of above Answer: (c) 56.What will be output if you will compile and execute the following c code? int extern x; void main() printf("%d",x); x=2; getch(); } int x=23; (a) 0 (b) 2 (c) 23 (d) Compiler error (e) None of these Answer: (c) 57.What will be output if you will compile and execute the following c code? void main(){ int a,b; a=1,3,15; b=(2,4,6);
  • 20. clrscr(); printf("%d ",a+b); getch(); } (a) 3 (b) 21 (c) 17 (d) 7 (e) Compiler error Answer: (d) 58.What will be output if you will compile and execute the following c code? void main(){ static main; int x; x=call(main); clrscr(); printf("%d ",x); getch(); } int call(int address){ address++; return address; } (a) 0 (b) 1 (c) Garbage value (d) Compiler error (e) None of these Answer: (b) 59.What will be output if you will compile and execute the following c code? #include "string.h" void main(){ clrscr(); printf("%d %d",sizeof("string"),strlen("string")); getch(); } (a) 6 6 (b) 7 7 (c) 6 7 (d) 7 6 (e) None of these Answer: (d) 60.What will be output if you will compile and execute the following c code? void main(){ int huge*p=(int huge*)0XC0563331; int huge*q=(int huge*)0xC2551341; *p=200; printf("%d",*q); } (a)0 (b)Garbage value (c)null (d) 200 (e)Compiler error
  • 21. Answer: (d) 61. What is the right way to access value of structure variable book{ price, page }? A. printf("%d%d", book.price, book.page); B. printf("%d%d", price.book, page.book); C. printf("%d%d", price::book, page::book); D. printf("%d%d", price->book, page->book); Answer : A 62. perror( ) function used to ? A. Work same as printf() B. prints the error message specified by the compiler C. prints the garbage value assigned by the compiler D. None of the above Answer : B 63. Bitwise operators can operate upon? A. double and chars B. floats and doubles C. ints and floats D. ints and chars Answer : D 64. What is C Tokens? A. The smallest individual units of c program B. The basic element recognized by the compiler C. The largest individual units of program D. A & B Both Answer : D 65. What is Keywords? A. Keywords have some predefine meanings and these meanings can be changed. B. Keywords have some unknown meanings and these meanings cannot be changed. C. Keywords have some predefine meanings and these meanings cannot be changed. D. None of the above Answer : C 66. What is constant? A. Constants have fixed values that do not change during the execution of a program B. Constants have fixed values that change during the execution of a program C. Constants have unknown values that may be change during the execution of a program D. None of the above Answer : A 67. Which is the right way to declare constant in C? A. int constant var =10; B. int const var = 10; C. const int var = 10; D. B & C Both Answer : D 68. Which operators are known as Ternary Operator? A. ::, ? B. ?, : C. ?, ;;
  • 22. D. None of the avobe Answer : B 69. In switch statement, each case instance value must be _______? A. Constant B. Variable C. Special Symbol D. None of the avobe Answer : A 70. What is the work of break keyword? A. Halt execution of program B. Restart execution of program C. Exit from loop or switch statement D. None of the avobe Answer : C