What is printed by this C code: printf(“%08.3f”, 3.14159);?
Correct answer B. 0003.142
Topic / 110 questions
C Language MCQs test core knowledge of the C programming language, including pointers, keywords, variable naming, function prototypes and its history. They help computer science students, IT job applicants and candidates for programming sections of recruitment tests. Every question shows its correct answer instantly, so you can check your understanding as you practise.
Correct answer B. 0003.142
Correct answer A. %p
Correct answer B. It left-justifies 42 within a 6-character field
Correct answer B. %zu
Correct answer D. %lf
Correct answer D. ff 10
Correct answer D. A negative integer
Correct answer D. 42
Correct answer C. 255
Correct answer B. <ctype.h>
Correct answer D. memmove()
Correct answer C. The behaviour is undefined
Correct answer C. It modifies i twice without sequencing, which is undefined behaviour
Correct answer B. The behaviour is undefined
Correct answer A. Modifying a string literal is undefined behaviour
Correct answer D. The order is unspecified, so either may be called first
Correct answer A. 8
Correct answer A. 0 6
Correct answer A. It creates ulong as another name for the existing type unsigned long
Correct answer A. Assignment with =
This short set covers fundamentals often asked in interviews and written tests. Questions cover null pointers, which point to nothing, and dangling pointers, which still point to memory that has been freed. You will also find items on far pointers, function prototypes, reserved keywords, and the rule that a variable name can begin with a letter or an underscore but not a digit. History questions ask who developed C, Dennis Ritchie at Bell Labs in the early 1970s. These basics are tested in campus placements and computer science lecturer and IT job tests.
Pakistan
India
Bangladesh
The C language was developed by Dennis Ritchie at Bell Laboratories in the early 1970s, mainly to write the UNIX operating system. He is widely known as the father of C. C remains important because many later languages, such as C++ and Java, borrow its syntax.
A null pointer holds no valid address and points to nothing. A dangling pointer still holds the address of memory that has been freed or has gone out of scope. Using a dangling pointer leads to undefined behaviour, so it is good practice to set freed pointers to NULL.
Last reviewed October 2026