C Programming Viva Questions and Answers
Quick C programming viva revision covering core syntax, control structures, arrays, functions, pointers, structures and file handling.
- What is C programming?
C is a general-purpose procedural programming language.
- What is the purpose of main() in a C program?
It is the function where program execution begins in a hosted C program.
- What is a variable?
A named object used to store a value that can change during program execution.
- What is a data type?
A type that describes the kind of value an object can hold and helps determine its representation and operations.
- What is the difference between = and ==?
= is assignment; == tests equality.
- What is the purpose of a loop?
Review the relevant topic page, then explain the concept in your own words and give a small example.
- What is an array?
Review the relevant topic page, then explain the concept in your own words and give a small example.
- What is a string in C?
Review the relevant topic page, then explain the concept in your own words and give a small example.
- What is a function?
Review the relevant topic page, then explain the concept in your own words and give a small example.
- What is a pointer?
A pointer is an object that stores an address or can be used to refer to an object indirectly.
- What do & and * mean in pointer expressions?
Review the relevant topic page, then explain the concept in your own words and give a small example.
- What is a structure?
Review the relevant topic page, then explain the concept in your own words and give a small example.
- What is a file pointer?
Review the relevant topic page, then explain the concept in your own words and give a small example.
- Why should a file be closed after use?
Review the relevant topic page, then explain the concept in your own words and give a small example.