C programming viva is an important part of engineering and computer science practical examinations. Many students feel nervous because questions are often asked directly and require clear answers. This post covers the most important C viva questions that are frequently asked in exams and interviews.
These questions are simple, conceptual, and very useful for beginners.
---
1. What is C language?
C is a general-purpose, procedural programming language developed by Dennis Ritchie. It is widely used for system programming and application development.
2. Who developed C language?
C language was developed by Dennis Ritchie in 1972 at Bell Laboratories.
3. What are the features of C language?
C language is simple, fast, portable, structured, and supports low-level programming.
4. What is a compiler?
A compiler is a program that converts the entire source code written in C into machine code at once.
5. What is a keyword in C?
Keywords are reserved words in C that have predefined meanings, such as int, float, if, else, and return.
6. What is a variable?
A variable is a named memory location used to store data during program execution.
7. What are data types in C?
Data types specify the type of data a variable can hold. Examples include int, float, char, and double.
8. What is the difference between int and float?
int stores whole numbers, while float stores decimal numbers.
9. What is a constant?
A constant is a fixed value that cannot be changed during program execution.
10. What is an operator?
An operator is a symbol used to perform operations on variables and values, such as +, -, *, and /.
11. What is an array?
An array is a collection of similar data types stored in contiguous memory locations.
12. What is a string in C?
A string is an array of characters terminated by a null character '\0'.
13. What is a function?
A function is a block of code that performs a specific task and can be called multiple times.
14. What is the main function?
The main function is the entry point of a C program where execution begins.
15. What is recursion?
Recursion is a process where a function calls itself until a base condition is met.
16. What is a pointer?
A pointer is a variable that stores the address of another variable.
17. What is NULL pointer?
A NULL pointer is a pointer that does not point to any valid memory location.
18. What is dynamic memory allocation?
Dynamic memory allocation allows memory to be allocated at runtime using functions like malloc and calloc.
19. What is the use of sizeof operator?
The sizeof operator is used to find the size of a data type or variable in bytes.
20. What is a structure?
A structure is a user-defined data type that groups variables of different data types.
21. What is a union?
A union is similar to a structure but shares memory among its members.
22. What is the difference between structure and union?
In a structure, each member has separate memory, while in a union all members share the same memory.
23. What is a header file?
A header file contains function declarations and macro definitions used in a C program.
24. What is printf function?
printf is used to display output on the screen.
25. What is scanf function?
scanf is used to take input from the user.
---
Conclusion
These C viva questions are commonly asked in practical exams and interviews. Understanding these concepts will help students answer confidently and score better marks. Practicing such questions regularly improves clarity and programming fundamentals.
Comments
Post a Comment