0% found this document useful (0 votes)
2 views6 pages

Cprogmcq

C Programming MCQS

Uploaded by

1ds22md034
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views6 pages

Cprogmcq

C Programming MCQS

Uploaded by

1ds22md034
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

1. Array is ______ datatype in C Programming language.

i) Derived Data type ii) Primitive Data type iii) Custom Data type iv) None of these

2. How many keywords are there in C Language ?

i) 30 ii) 22 iii) 32 iv) 36


3. Which of the following cannot be a variable name in C?

i) volatile ii) true iii) friend iv) export


4. If you have to make decision based on multiple choices, which of the following is best suited?
i) if ii) if-else iii) if-else-if iv) All of the above
5. Which of the following are themselves a collection of different data types?
i) String ii) Structure iii) Char iv) All of the mentioned
6. Every C Program should contain which function
i) printf() ii) show() iii) scanf() iv) main()
7. The keyword used to transfer control from a function back to the calling function is
i) switch ii) goto iii) go back iv) return
8. Who is the father of Computers?
i) James Goslin ii) Charles Babbage iii) Dennis Ritchi iv) Bjarne Stroustrup
9. Choose a correct C for loop syntax.
i) for(initialization; condition; increment or decrement)
{
//statements
}
ii) for(declaration; condition; increment operation)
{
//statements
}
iii) for(declaration; increment operation; condition)
{
//statements
}
iv) for(initialization; condition; increment operation;)
{
//statements
}
10. What is #include <stdio.h>?
i) Preprocessor directive ii) Inclusion directive iii) File inclusion directive
iv) None of the mentioned

11. What is the full form of CPU?


i) Computer Processing Unit ii) Computer Principle Unit iii) Central Processing Unit
iv) Control Processing Unit

12. What is the way to suddenly come out of or Quit any Loop in C Language.?
i) continue; statement
ii) break; statement
iii) leave; statement
iv) quit; statement
13. A function which calls itself is called a ___ function.
i) Self Function ii) Auto Function iii) Recursive Function iv) Static Function
14. Which function will you choose to join two words?
i) strcpy() ii) strcat() iii) strncon() iv) memcon()
15. What is a structure in C language?
i) A structure is a collection of elements that can be of same datatype
ii) A structure is a collection of elements that can be of different datatype
iii) Elements of a structure are called members
iv) All of the these
16. What will be the size of the following structure?
#include <stdio.h>
struct temp {
int a[10];
char p;
};
i) 5 ii) 11 iii) 41 iv) 44
17. A pointer is a
i) variable that stores address of an instruction
ii) variable that stores address of other variable
iii) keyword used to create variables
iv) None of these
18. Address stored in the pointer variable is of type _______.
i) integer ii) character iii) float iv) array
19. Comment on the following pointer declaration?
int *ptr, p;
i) ptr is a pointer to integer, p is not
ii) ptr and p, both are pointers to integer
iii) ptr is pointer to integer, p may or may not be
iv) ptr and p both are not pointers to integer

20. What will strcmp() function do?


i) compares the first n characters of the object
ii) undefined function
iii) copies the string
iv) compares the string

21. A function which calls itself is called a ___ function.


a) Self Function
b) Auto Function
c) Recursive Function
d) Static Function
option C

22.The keyword used to transfer control from a function back to the calling function is
int **a;
a) switch
b) goto
c) go back
d) return
option D

23.The keyword used to transfer control from a function back to the calling function is
int **a;
a) switch
b) goto
c) go back
d) return
option C

24.Every C Program should contain which function


a) printf()
b) show()
c) scanf()
d) main()
Option D

25. Who is the father of Computers?


i) James Goslin ii) Charles Babbage iii) Dennis Ritchi iv) Bjarne Stroustrup

26. What is the full form of CPU?


i) Computer Processing Unit ii) Computer Principle Unit iii) Central Processing Unit iv)
Control Processing Unit

27. What is the 16-bit compiler allowable range for integer constants?
i) -3.4e38 to 3.4e38 ii) -32767 to 32768 iii) -32668 to 32667 iv) -32768 to
32767
28. Who is the father of C language?
i) Steve Jobs ii) James Gosling iii) Dennis Ritchie iv) Rasmus Lerdorf
29. Which of the following cannot be a variable name in C?
i) volatile ii) true iii) friend iv) export
30. Choose a correct C for loop syntax.

i) for(initialization; condition; increment or decrement)

{
//statements
}

ii) for(declaration; condition; increment operation)

{
//statements
}
iii) for(declaration; increment operation; condition)

{
//statements
}
iv) for(initialization; condition; increment operation;)

{
//statements
}

31. What is the result of logical or relational expression in C?


i) True or False ii) 0 or 1
iii) 0 if an expression is false and any positive number if an expression is true
iv) None of the mentioned

32. Which loop is faster in C language, for, while or do while. ?


i) for ii) while iii) do while iv) all work at same speed

33. How many number of pointer (*) does C have against a pointer variable declaration?
i) 7 ii) 127 iii) 255 iv) No limits

You might also like