
C Programming MCQs 2025 (Questions with Answers)
This is the best C Programming MCQs with answers for the LT Grade Computer Teacher exam 2025. The collection of C language multiple-choice questions is designed to cover all important topics like variables, data types, operators, control statements, arrays, strings, pointers, functions, structures, and file handling. Practicing these objective type C programming questions helps in quick revision and improves accuracy for all competitive exams. These C programming practice questions are ideal for LT Grade preparation, teaching exams, and computer science interviews. Start solving C programming MCQ questions with answers today and strengthen your fundamentals for exam success.
C Programming MCQs Part -2 for LT Grade Computer Teacher Exam 2025
- The operator
++i
is called:
a) Post-increment
b) Pre-increment
c) Decrement
d) None
Answer: b) Pre-increment - The operator
i++
is called:
a) Pre-increment
b) Post-increment
c) Decrement
d) None
Answer: b) Post-increment - Which operator is known as conditional operator?
a) &&
b) ?:
c) ==
d) ||
Answer: b) ?: - The
sizeof
operator returns:
a) Integer
b) Float
c) Double
d) Long double
Answer: a) Integer - Which of the following is a bitwise operator?
a) &
b) |
c) ^
d) All of these
Answer: d) All of these
Loops & Control Flow
- If
for(;;)
is used, it means:
a) Infinite loop
b) Compile error
c) Loop executes once
d) None
Answer: a) Infinite loop - The default scope of a variable inside a function is:
a) global
b) static
c) local
d) extern
Answer: c) local - The
goto
statement transfers control to:
a) Next function
b) A labeled statement
c) Loop start
d) Main function
Answer: b) A labeled statement - A function in C can return how many values?
a) 1
b) 2
c) Multiple
d) 0
Answer: a) 1 - Which keyword is used to exit program execution immediately?
a) return
b) break
c) exit()
d) stop()
Answer: c) exit()
Functions
- Functions with same name but different parameters are called:
a) Overloaded
b) Inline
c) Recursive
d) None (not supported in C)
Answer: d) None - A function prototype ends with:
a) ;
b) )
c) :
d) ,
Answer: a) ; - Which of the following is a valid function definition?
a) int func;
b) int func() { }
c) func() int;
d) void func[];
Answer: b) int func() { } - Passing array to a function is done by:
a) Value
b) Reference
c) Both
d) None
Answer: b) Reference - The main() function in C returns:
a) void
b) int
c) float
d) char
Answer: b) int
Arrays & Strings
- What is the index of last element in array
int a[10];
?
a) 10
b) 9
c) 11
d) Compiler decides
Answer: b) 9 - The base address of array is stored in:
a) First element
b) Last element
c) Pointer variable
d) Array name itself
Answer: d) Array name itself - Which of the following is valid string declaration?
a) char s[] = “Hello”;
b) char s[5] = “Hello”;
c) char s[6] = “Hello”;
d) Both a and c
Answer: d) Both a and c - Which function is used to compare two strings?
a) strcmp()
b) strcat()
c) strcpy()
d) strlen()
Answer: a) strcmp() - Which function is used to concatenate two strings?
a) strcat()
b) strcmp()
c) strcpy()
d) strrev()
Answer: a) strcat()
Pointers
- What is the output of
printf("%d", NULL);
?
a) 0
b) 1
c) Error
d) Garbage
Answer: a) 0 - A pointer that does not point to any valid address is called:
a) Wild pointer
b) Null pointer
c) Dangling pointer
d) Void pointer
Answer: b) Null pointer - A pointer that is not initialized is called:
a) Dangling pointer
b) Wild pointer
c) Null pointer
d) Void pointer
Answer: b) Wild pointer - Which keyword is used to declare a pointer to any data type?
a) any
b) void
c) gen
d) none
Answer: b) void - Which of the following denotes address-of operator?
a) *
b) &
c) ->
d) .
Answer: b) &
Structures & Unions
- Which keyword is used to define a structure?
a) struct
b) struc
c) structure
d) str
Answer: a) struct - Members of a structure are accessed using:
a) .
b) ->
c) *
d) Both a and b
Answer: d) Both a and b - The size of union is equal to:
a) Sum of members
b) Size of largest member
c) Average of members
d) Depends on compiler
Answer: b) Size of largest member - Which keyword is used to define a union?
a) union
b) struct
c) combine
d) mix
Answer: a) union - Structure members are by default:
a) private
b) public
c) protected
d) none (C doesn’t support access specifiers)
Answer: d) none
File Handling
- Which function is used to close a file?
a) fclose()
b) fileclose()
c) close()
d) endfile()
Answer: a) fclose() - In C, EOF stands for:
a) End of Function
b) End of File
c) Error on File
d) Exit or Fail
Answer: b) End of File - What is returned by
fgetc()
when end of file is reached?
a) 0
b) NULL
c) EOF
d) -1
Answer: c) EOF - Which function is used to write a character to file?
a) putc()
b) fputc()
c) write()
d) fileput()
Answer: b) fputc() - Which file mode deletes old contents and writes new data?
a) a
b) r
c) w
d) rw
Answer: c) w
Miscellaneous
- The C program execution starts from:
a) top to bottom
b) main() function
c) header files
d) first function defined
Answer: b) main() function - Which keyword defines constants in C?
a) #define
b) const
c) Both a and b
d) static
Answer: c) Both a and b - The operator
->
is called:
a) Dot operator
b) Arrow operator
c) Pointer operator
d) Address operator
Answer: b) Arrow operator - Which of the following is not a keyword in C?
a) if
b) while
c) for
d) then
Answer: d) then - Which header file is required for malloc()?
a) stdio.h
b) conio.h
c) stdlib.h
d) string.h
Answer: c) stdlib.h
Advanced Concepts
- Enum in C is used to declare:
a) Constant values
b) Floating values
c) Array values
d) Pointers
Answer: a) Constant values - Which function is used to generate random numbers?
a) random()
b) rand()
c) randint()
d) rnd()
Answer: b) rand() - Which function is used to sort data in C standard library?
a) sort()
b) qsort()
c) quicksort()
d) order()
Answer: b) qsort() - Which of these is not a valid storage class in C?
a) auto
b) extern
c) static
d) dynamic
Answer: d) dynamic - The function
atoi()
is used for:
a) Integer to ASCII
b) ASCII to Integer
c) Array to Integer
d) None
Answer: b) ASCII to Integer - Which function is used to copy memory block?
a) memcpy()
b) strcpy()
c) strncpy()
d) memcopy()
Answer: a) memcpy() - A dangling pointer is created when:
a) Pointer is uninitialized
b) Memory is freed but pointer still points to it
c) Pointer is null
d) None
Answer: b) Memory is freed but pointer still points to it - The default value of uninitialized global variables in C is:
a) 0
b) NULL
c) Garbage
d) -1
Answer: a) 0 - Which of the following is a valid C identifier?
a) 123name
b) name_123
c) name-123
d) name\@123
Answer: b) name_123 - Which of the following is NOT allowed in C?
a) Nested functions
b) Nested loops
c) Nested if
d) Nested structures
Answer: a) Nested functions