C Programming MCQs 2025 (Questions with Answers) Part-2

C Programming MCQs 2025 (Questions with Answers)

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

  1. The operator ++i is called:
    a) Post-increment
    b) Pre-increment
    c) Decrement
    d) None
    Answer: b) Pre-increment
  2. The operator i++ is called:
    a) Pre-increment
    b) Post-increment
    c) Decrement
    d) None
    Answer: b) Post-increment
  3. Which operator is known as conditional operator?
    a) &&
    b) ?:
    c) ==
    d) ||
    Answer: b) ?:
  4. The sizeof operator returns:
    a) Integer
    b) Float
    c) Double
    d) Long double
    Answer: a) Integer
  5. Which of the following is a bitwise operator?
    a) &
    b) |
    c) ^
    d) All of these
    Answer: d) All of these

Loops & Control Flow

  1. If for(;;) is used, it means:
    a) Infinite loop
    b) Compile error
    c) Loop executes once
    d) None
    Answer: a) Infinite loop
  2. The default scope of a variable inside a function is:
    a) global
    b) static
    c) local
    d) extern
    Answer: c) local
  3. The goto statement transfers control to:
    a) Next function
    b) A labeled statement
    c) Loop start
    d) Main function
    Answer: b) A labeled statement
  4. A function in C can return how many values?
    a) 1
    b) 2
    c) Multiple
    d) 0
    Answer: a) 1
  5. Which keyword is used to exit program execution immediately?
    a) return
    b) break
    c) exit()
    d) stop()
    Answer: c) exit()

Functions

  1. Functions with same name but different parameters are called:
    a) Overloaded
    b) Inline
    c) Recursive
    d) None (not supported in C)
    Answer: d) None
  2. A function prototype ends with:
    a) ;
    b) )
    c) :
    d) ,
    Answer: a) ;
  3. 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() { }
  4. Passing array to a function is done by:
    a) Value
    b) Reference
    c) Both
    d) None
    Answer: b) Reference
  5. The main() function in C returns:
    a) void
    b) int
    c) float
    d) char
    Answer: b) int

Arrays & Strings

  1. What is the index of last element in array int a[10];?
    a) 10
    b) 9
    c) 11
    d) Compiler decides
    Answer: b) 9
  2. 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
  3. 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
  4. Which function is used to compare two strings?
    a) strcmp()
    b) strcat()
    c) strcpy()
    d) strlen()
    Answer: a) strcmp()
  5. Which function is used to concatenate two strings?
    a) strcat()
    b) strcmp()
    c) strcpy()
    d) strrev()
    Answer: a) strcat()

Pointers

  1. What is the output of printf("%d", NULL);?
    a) 0
    b) 1
    c) Error
    d) Garbage
    Answer: a) 0
  2. 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
  3. A pointer that is not initialized is called:
    a) Dangling pointer
    b) Wild pointer
    c) Null pointer
    d) Void pointer
    Answer: b) Wild pointer
  4. Which keyword is used to declare a pointer to any data type?
    a) any
    b) void
    c) gen
    d) none
    Answer: b) void
  5. Which of the following denotes address-of operator?
    a) *
    b) &
    c) ->
    d) .
    Answer: b) &

Structures & Unions

  1. Which keyword is used to define a structure?
    a) struct
    b) struc
    c) structure
    d) str
    Answer: a) struct
  2. Members of a structure are accessed using:
    a) .
    b) ->
    c) *
    d) Both a and b
    Answer: d) Both a and b
  3. 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
  4. Which keyword is used to define a union?
    a) union
    b) struct
    c) combine
    d) mix
    Answer: a) union
  5. Structure members are by default:
    a) private
    b) public
    c) protected
    d) none (C doesn’t support access specifiers)
    Answer: d) none

File Handling

  1. Which function is used to close a file?
    a) fclose()
    b) fileclose()
    c) close()
    d) endfile()
    Answer: a) fclose()
  2. 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
  3. What is returned by fgetc() when end of file is reached?
    a) 0
    b) NULL
    c) EOF
    d) -1
    Answer: c) EOF
  4. Which function is used to write a character to file?
    a) putc()
    b) fputc()
    c) write()
    d) fileput()
    Answer: b) fputc()
  5. Which file mode deletes old contents and writes new data?
    a) a
    b) r
    c) w
    d) rw
    Answer: c) w

Miscellaneous

  1. The C program execution starts from:
    a) top to bottom
    b) main() function
    c) header files
    d) first function defined
    Answer: b) main() function
  2. Which keyword defines constants in C?
    a) #define
    b) const
    c) Both a and b
    d) static
    Answer: c) Both a and b
  3. The operator -> is called:
    a) Dot operator
    b) Arrow operator
    c) Pointer operator
    d) Address operator
    Answer: b) Arrow operator
  4. Which of the following is not a keyword in C?
    a) if
    b) while
    c) for
    d) then
    Answer: d) then
  5. 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

  1. Enum in C is used to declare:
    a) Constant values
    b) Floating values
    c) Array values
    d) Pointers
    Answer: a) Constant values
  2. Which function is used to generate random numbers?
    a) random()
    b) rand()
    c) randint()
    d) rnd()
    Answer: b) rand()
  3. Which function is used to sort data in C standard library?
    a) sort()
    b) qsort()
    c) quicksort()
    d) order()
    Answer: b) qsort()
  4. Which of these is not a valid storage class in C?
    a) auto
    b) extern
    c) static
    d) dynamic
    Answer: d) dynamic
  5. 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
  6. Which function is used to copy memory block?
    a) memcpy()
    b) strcpy()
    c) strncpy()
    d) memcopy()
    Answer: a) memcpy()
  7. 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
  8. The default value of uninitialized global variables in C is:
    a) 0
    b) NULL
    c) Garbage
    d) -1
    Answer: a) 0
  9. Which of the following is a valid C identifier?
    a) 123name
    b) name_123
    c) name-123
    d) name\@123
    Answer: b) name_123
  10. 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