Viva Questions & Answers - GXEST204 (Programming in C Lab)
Viva Questions & Answers - GXEST204 (Programming in C Lab)
1. What is a compiler?
Answer:
A compiler is a software program that translates high-level source code written in a
programming language like C into machine code that a computer's processor can execute.
---
Answer:
The basic data types in C are:
int (Integer)
char (Character)
---
Answer:
---
4. What is a loop? What types of loops are there in C?
Answer:
A loop is a control structure that allows repeated execution of a block of code. Types of loops in
C are:
for loop
while loop
do-while loop
---
5. What is an array in C?
Answer:
An array is a collection of elements of the same data type stored in contiguous memory
locations. It is accessed using an index.
---
Answer:
Call by value passes a copy of the variable, and changes do not affect the original variable.
Call by reference passes the address of the variable, so changes affect the original variable.
---
7. What is a pointer in C?
Answer:
A pointer is a variable that stores the memory address of another variable.
---
8. What are the advantages of using functions in C?
Answer:
Functions:
Improve modularity
---
9. What is recursion?
Answer:
Recursion is a technique where a function calls itself either directly or indirectly to solve a
problem.
---
Answer:
A structure is a user-defined data type in C that allows grouping variables of different types
under one name.
---
Answer:
Answer:
---
Answer:
The main() function is the entry point of every C program. Execution starts from the main()
function.
---
Answer:
continue skips the current iteration and proceeds with the next iteration of the loop.
---
Answer:
Typecasting is the conversion of one data type into another, e.g., from float to int.