CDCDAC Prep
C-CATSection B: C, C++, DSA, OS, Networking & AI•20 Questions

C Programming Practice MCQs

Topic Covered in this Question Set

Introduction to C Programming; C Program Structure; Data Types and Variables

Click on an option to check your answer immediately. Full solution & explanation provided for every question.

Interactive Practice Mode

C Programming Free MCQs

Select an option to test your knowledge with real exam questions and instant explanations.

Total20
Correct0
Wrong0
Progress: 0 of 20 answered0% Accuracy
Q1 of 20

Which data type is most suitable to store the number 65000 on a 32-bit system?

Open topic in App →
Q2 of 20

What is printed? ```c signed char a = 322; unsigned char b = -1; printf("%d %d %c", b-a, sizeof(a=1), a); ```

Open topic in App →
Q3 of 20

Which of the following is NOT a valid escape sequence?

Open topic in App →
Q4 of 20

Which of the following does `\r` do?

Open topic in App →
Q5 of 20

Copy one structure to another:

Open topic in App →
Q6 of 20

What is the range of a `signed short` on most 32-bit systems?

Open topic in App →
Q7 of 20

Bit-fields: which is FALSE?

Open topic in App →
Q8 of 20

Which of the following is an implicit typecast?

Open topic in App →
Q9 of 20

`sizeof` a structure:

Open topic in App →
Q10 of 20

What is printed? ```c signed char ch = 128; printf("%d", ch); ```

Open topic in App →
Q11 of 20

Output? ```c typedef struct { int a1; char ch; } demo_t; demo_t s1={1}, s2={1}; if (s1 == s2) ... else ... ```

Open topic in App →
Q12 of 20

A nested structure:

Open topic in App →
Q13 of 20

Output? ```c union demo { int a1; unsigned k1:2; unsigned char s1:6; } st; st.s1=127; st.k1=8; st.a1=15; int *p = st.a1; ++*p; // Treating int as pointer … ```

Open topic in App →
Q14 of 20

What does the following code print? ```c short x = 32767; x = x + 1; printf("%d\n", x); ```

Open topic in App →
Q15 of 20

Which is NOT a type modifier in C?

Open topic in App →
Q16 of 20

Output? `printf("%d", sizeof('A'));` (C compiler, not C++)

Open topic in App →
Q17 of 20

Struct member can be pointer to same struct type?

Open topic in App →
Q18 of 20

Which keyword allows a variable's address to be taken?

Open topic in App →
Q19 of 20

Short alias for a struct type:

Open topic in App →
Q20 of 20

Which of the following is an automatic variable?

Open topic in App →
Need to review the concepts?

Read C Programming Study Notes

Review complete topic notes, syntax guides, code examples, and summary tables.

Read Free Study Notes →