C Programming Question Paper
Section A: Objective Type Questions (Each question carries 1 mark)
1. What is the output of the following code?
#include<stdio.h>
int main() {
printf("%d", 5 + 3 * 2);
return 0;
2. Which of the following is not a valid variable name in C?
a) var_1
b) 1var
c) _var
d) var1
3. Which data type is used to store a single character?
a) int
b) float
c) char
d) double
Section B: Short Answer Questions (Each question carries 2 marks)
1. Explain the difference between `while` and `do-while` loops with examples.
2. Write a C program to find the largest of three numbers entered by the user.
3. What is a pointer? Write a program to demonstrate pointer arithmetic.
Section C: Long Answer Questions (Each question carries 5 marks)
1. Write a C program to implement bubble sort. Explain the logic with comments in the code.
2. Discuss the concept of dynamic memory allocation in C with examples using `malloc` and `free`
functions.
3. Explain file handling in C. Write a program to read from and write to a file.