C Programming
C language from basics to advanced placement prep
1,000 Questions 10 Topics Take Test
Advertisement
Showing 991–1000 of 1,000 questions
Q.991 Easy Basics & Syntax
Which escape sequence represents a tab character in C?
A \t
B \tab
C \n
D \s
Correct Answer:  A. \t
EXPLANATION

\t is the escape sequence for a tab character. \n is for newline, \s is invalid in C.

Take Test
Q.992 Hard Basics & Syntax
What will be the output of: int x = 10; printf("%d %d", x, x++);
A 10 10
B 10 11
C 11 10
D Undefined behavior
Correct Answer:  D. Undefined behavior
EXPLANATION

Modifying and using a variable in the same expression without an intervening sequence point results in undefined behavior.

Take Test
Q.993 Easy Basics & Syntax
What is the purpose of the main() function in C?
A To declare variables
B To include header files
C Entry point of program execution
D To define functions
Correct Answer:  C. Entry point of program execution
EXPLANATION

The main() function is the entry point where program execution begins. Every C program must have a main() function.

Take Test
Q.994 Medium Basics & Syntax
Which of the following is the correct way to define a constant in C?
A #define PI 3.14
B const float PI = 3.14;
C Both A and B are correct
D Neither A nor B is correct
Correct Answer:  C. Both A and B are correct
EXPLANATION

Both #define and const can be used to define constants in C. #define is a preprocessor directive, while const is a type qualifier.

Take Test
Q.995 Easy Basics & Syntax
What is the output of: printf("%d", 5 + 3 * 2)?
A 16
B 11
C 21
D 13
Correct Answer:  B. 11
EXPLANATION

Following operator precedence, multiplication (*) has higher precedence than addition (+). So 3*2=6, then 5+6=11.

Take Test
Advertisement
Q.996 Medium Basics & Syntax
Which of the following is NOT a valid C keyword?
A extern
B volatile
C mutable
D register
Correct Answer:  C. mutable
EXPLANATION

mutable is a C++ keyword, not a C keyword. extern, volatile, and register are valid C keywords.

Take Test
Q.997 Easy Basics & Syntax
What does the following code snippet output?
#include
int main() {
int x = 5;
printf("%d", x++);
return 0;
}
A 5
B 6
C undefined
D Compilation error
Correct Answer:  A. 5
EXPLANATION

x++ is post-increment. The value 5 is printed first, then x is incremented to 6.

Take Test
Q.998 Easy Basics & Syntax
Which header file is required to use the printf() function?
A #include
B #include
C #include
D #include
Correct Answer:  B. #include
EXPLANATION

stdio.h (Standard Input Output header) is required for printf() and scanf() functions.

Take Test
Q.999 Easy Basics & Syntax
What is the size of int data type in a 32-bit system?
A 2 bytes
B 4 bytes
C 8 bytes
D 1 byte
Correct Answer:  B. 4 bytes
EXPLANATION

In a 32-bit system, int is typically 4 bytes (32 bits). The size may vary depending on the compiler.

Take Test
Q.1000 Easy Basics & Syntax
Which of the following is the correct syntax to declare a variable in C?
A int x;
B int x
C int: x;
D declare int x;
Correct Answer:  A. int x;
EXPLANATION

In C, variable declaration requires a semicolon at the end. The syntax is 'data_type variable_name;'

Take Test
IGET
iget AI
Online · Ask anything about exams
Hi! 👋 I'm your iget AI assistant.

Ask me anything about exam prep, MCQ solutions, study tips, or strategies! 🎯
UPSC strategy SSC CGL syllabus Improve aptitude NEET Biology tips