iGET

C Programming - MCQ Practice Questions

C questions in placement tests and university exams are rarely about syntax alone. Most of what you will find here is output prediction, pointer arithmetic, arrays and strings, structures and unions, storage classes, recursion, and file handling. The explanations walk through memory behaviour step by step, which is usually where the confusion sits rather than in the code itself.

972 questions | 100% Free

Q.1Medium

What will be the output of the following code?
int x = 5;
float y = x;
printf("%f", y);

Q.2Medium

Which of the following occupies maximum memory in a 64-bit system?

Q.3Medium

What is the range of unsigned int in a 32-bit system?

Q.4Medium

What is the difference between 'static' and 'extern' variables?

Q.5Medium

What is the output of the following code?
int x = 10;
int *p = &x;
printf("%d", *p);

Q.6Medium

Which variable storage class has default initialization to 0?

Q.7Medium

What is the output of this code?
float x = ;
printf("%f", x);

Q.8Medium

What happens when you declare a variable without initializing it?

Q.9Medium

Which data type is most suitable for storing a decimal number with high precision?

Q.10Medium

In C, which storage class has the longest scope and lifetime?

Q.11Medium

Which storage class variable is automatically initialized to 0 if not explicitly initialized?

Q.12Medium

Consider: long long int x; What is the minimum guaranteed size of x according to C standard?

Q.13Medium

Which of the following demonstrates proper type casting in C?

Q.14Medium

What is the difference between 'signed' and 'unsigned' char in terms of range?

Q.15Medium

Which keyword prevents a local variable from being optimized by compiler into a register?

Q.16Medium

In the declaration 'int *p, q;', what are the data types of p and q?

Q.17Medium

What happens when you attempt to store a double value in an int variable without explicit casting?

Q.18Medium

Which of the following is a correct way to declare a constant variable in modern C?

Q.19Medium

What is the output of: printf("%d", sizeof(char) + sizeof(int) + sizeof(float)); on a typical 32-bit system?

Q.20Medium

A variable declared with 'register' storage class suggests to the compiler to store it in: