0% found this document useful (0 votes)
34 views4 pages

Viva Questions & Answers - GXEST204 (Programming in C Lab)

The document provides a series of questions and answers related to programming in C, covering fundamental concepts such as compilers, data types, loops, arrays, pointers, functions, recursion, structures, and typecasting. It explains key differences between operators, call by value and reference, and the use of standard input/output functions. Additionally, it outlines the purpose of the main function and the behavior of control statements like break and continue.

Uploaded by

meghaanoop67
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views4 pages

Viva Questions & Answers - GXEST204 (Programming in C Lab)

The document provides a series of questions and answers related to programming in C, covering fundamental concepts such as compilers, data types, loops, arrays, pointers, functions, recursion, structures, and typecasting. It explains key differences between operators, call by value and reference, and the use of standard input/output functions. Additionally, it outlines the purpose of the main function and the behavior of control statements like break and continue.

Uploaded by

meghaanoop67
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

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.

---

2. What are the basic data types in C?

Answer:
The basic data types in C are:

int (Integer)

float (Floating-point number)

char (Character)

double (Double-precision floating-point number)

void (No value)

---

3. What is the difference between =, ==, and != operators?

Answer:

= is the assignment operator.

== checks for equality.

!= checks for inequality.

---
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.

---

6. What is the difference between call by value and call by reference?

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:

Help in code reusability

Improve modularity

Make programs easier to read and debug

---

9. What is recursion?

Answer:
Recursion is a technique where a function calls itself either directly or indirectly to solve a
problem.

---

10. What is a structure in C?

Answer:
A structure is a user-defined data type in C that allows grouping variables of different types
under one name.

---

11. How is a structure different from a union?

Answer:

In structures, each member has its own memory.

In unions, all members share the same memory space.


---

12. What is the use of scanf() and printf()?

Answer:

scanf() is used to take input from the user.

printf() is used to display output to the user.

---

13. What is the purpose of the main() function?

Answer:
The main() function is the entry point of every C program. Execution starts from the main()
function.

---

14. What is the difference between break and continue statements?

Answer:

break exits the loop or switch.

continue skips the current iteration and proceeds with the next iteration of the loop.

---

15. What is typecasting in C?

Answer:
Typecasting is the conversion of one data type into another, e.g., from float to int.

You might also like