
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 for LT Grade Computer Teacher Exam 2025
Basics of C
- C language was developed by?
a) Dennis Ritchie
b) Ken Thompson
c) James Gosling
d) Charles Babbage
Answer: a) Dennis Ritchie - C language was developed at?
a) Bell Labs
b) Microsoft
c) Sun Microsystems
d) IBM
Answer: a) Bell Labs - Which year was C developed?
a) 1970
b) 1972
c) 1979
d) 1983
Answer: b) 1972 - C language is a:
a) High level language
b) Low level language
c) Middle level language
d) Machine language
Answer: c) Middle level language - Which of the following is the file extension of C program files?
a) .cpp
b) .c
c) .java
d) .py
Answer: b) .c
Data Types & Operators
- Size of int on a 32-bit system is:
a) 2 bytes
b) 4 bytes
c) 8 bytes
d) Depends on compiler
Answer: b) 4 bytes - The default return type of a function in C is:
a) void
b) int
c) float
d) double
Answer: b) int - Which of the following is NOT a valid data type in C?
a) int
b) float
c) real
d) char
Answer: c) real - Which operator is used to access the value at an address?
a) &
b) *
c) ->
d) .
Answer: b) * - The modulus operator (%) can be applied to:
a) int only
b) float only
c) int and float both
d) char only
Answer: a) int only
Control Statements
- Which keyword is used for decision making?
a) loop
b) switch
c) case
d) if
Answer: d) if - Which loop is guaranteed to execute at least once?
a) for
b) while
c) do-while
d) nested for
Answer: c) do-while - The break statement is used for:
a) Exit from loop
b) Continue next iteration
c) End program
d) None
Answer: a) Exit from loop - Which keyword transfers control to the beginning of the loop?
a) break
b) continue
c) goto
d) return
Answer: b) continue - Switch-case works with:
a) float
b) double
c) int & char
d) string
Answer: c) int & char
Functions & Storage Classes
- Functions in C are by default:
a) inline
b) global
c) extern
d) static
Answer: c) extern - Which keyword is used to define a function?
a) define
b) func
c) void / return type
d) function
Answer: c) void / return type - Static variables are stored in:
a) Heap
b) Stack
c) Data segment
d) CPU register
Answer: c) Data segment - Which storage class has default value 0?
a) auto
b) static
c) register
d) extern
Answer: b) static - Recursion in C means:
a) Function calling itself
b) Loop inside function
c) Function calling another function
d) None
Answer: a) Function calling itself
Pointers & Arrays
- Pointer in C is used to store:
a) Value of variable
b) Address of variable
c) Both
d) None
Answer: b) Address of variable - Which symbol is used to declare a pointer?
a) &
b) *
c) ->
d) %
Answer: b) * - An array index in C starts from:
a) -1
b) 0
c) 1
d) Depends on compiler
Answer: b) 0 - Which of these is a correct declaration?
a) int arr[];
b) int arr[10];
c) int arr(10);
d) array int[10];
Answer: b) int arr[10]; - A 2D array
int a[3][4];
has how many elements?
a) 7
b) 12
c) 24
d) 36
Answer: b) 12
Strings & Memory
- Strings in C are terminated with:
a) ;
b) \n
c) \0
d) null pointer
Answer: c) \0 - Which header file is required for string functions?
a) stdio.h
b) string.h
c) conio.h
d) stdlib.h
Answer: b) string.h strlen("Hello")
returns:
a) 4
b) 5
c) 6
d) 7
Answer: b) 5- Which function is used to allocate memory dynamically?
a) malloc()
b) calloc()
c) realloc()
d) free()
Answer: a) malloc() - Which function is used to release memory?
a) delete()
b) remove()
c) free()
d) dispose()
Answer: c) free()
Input/Output
- Which function is used to print output in C?
a) cout
b) print
c) printf
d) display
Answer: c) printf - Which function is used to take input in C?
a) cin
b) input
c) scanf
d) read
Answer: c) scanf - Format specifier for float is:
a) %d
b) %c
c) %f
d) %lf
Answer: c) %f - Format specifier for double is:
a) %f
b) %lf
c) %d
d) %Ld
Answer: b) %lf - Format specifier for unsigned int is:
a) %u
b) %d
c) %lu
d) %ld
Answer: a) %u
Preprocessor & Files
- Header files in C have extension:
a) .cpp
b) .h
c) .hpp
d) .hdr
Answer: b) .h - Preprocessor directives start with:
a) $
b) #
c) %
d) @
Answer: b) # - Macro in C is defined using:
a) #define
b) #macro
c) #include
d) #func
Answer: a) #define - Which function is used to open a file?
a) open()
b) fopen()
c) fileopen()
d) newfile()
Answer: b) fopen() - Which mode is used to append data in a file?
a) w
b) r
c) a
d) x
Answer: c) a
Advanced
- sizeof(char) is always:
a) 1
b) 2
c) 4
d) Depends on OS
Answer: a) 1 - Which of the following is not a loop in C?
a) for
b) while
c) foreach
d) do-while
Answer: c) foreach - The keyword used to exit from a function is:
a) exit
b) break
c) return
d) stop
Answer: c) return - Which operator has the highest precedence?
a) +
b) =
c) ()
d) &&
Answer: c) () - Which of the following is a logical operator?
a) &&
b) ||
c) !
d) All of these
Answer: d) All of these - Null pointer in C is represented as:
a) 0
b) NULL
c) (void*)0
d) All of these
Answer: d) All of these - A function that calls itself is called:
a) Recursive
b) Inline
c) Static
d) Global
Answer: a) Recursive - Which keyword is used to include library files?
a) import
b) include
c) #include
d) library
Answer: c) #include - Which operator is used to access structure members?
a) .
b) ->
c) *
d) &
Answer: a) . - To access members of a structure through pointer, we use:
a) .
b) ->
c) *
d) &
Answer: b) ->