0% found this document useful (0 votes)
7 views2 pages

C Programming Question Paper

The document is a C programming question paper divided into three sections: Objective Type Questions, Short Answer Questions, and Long Answer Questions. It includes questions on code output, variable names, data types, loops, pointers, sorting algorithms, dynamic memory allocation, and file handling. Each section has questions of varying marks, testing different levels of understanding in C programming.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

C Programming Question Paper

The document is a C programming question paper divided into three sections: Objective Type Questions, Short Answer Questions, and Long Answer Questions. It includes questions on code output, variable names, data types, loops, pointers, sorting algorithms, dynamic memory allocation, and file handling. Each section has questions of varying marks, testing different levels of understanding in C programming.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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.

You might also like