0% found this document useful (0 votes)
0 views

C Programming Question Paper

The document is a C Programming question paper consisting of three sections: Multiple Choice Questions (5 questions worth 5 marks), Short Answer Questions (5 questions worth 10 marks), and a Problem Solving section (1 question worth 5 marks). Each section tests different aspects of C programming knowledge and skills. The total marks for the paper are 20, and the time allocated for completion is 45 minutes.

Uploaded by

Prashant Astekar
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

C Programming Question Paper

The document is a C Programming question paper consisting of three sections: Multiple Choice Questions (5 questions worth 5 marks), Short Answer Questions (5 questions worth 10 marks), and a Problem Solving section (1 question worth 5 marks). Each section tests different aspects of C programming knowledge and skills. The total marks for the paper are 20, and the time allocated for completion is 45 minutes.

Uploaded by

Prashant Astekar
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

C Programming Question Paper

Total Marks: 20
Time: 45 minutes

Section A: Multiple Choice Questions (MCQs)

(Each question carries 1 mark)


[5 Marks]

1. What is the output of the following code?

2. #include<stdio.h>

3. int main() {

4. printf("%d", 5 + 3 * 2);

5. return 0;

6. }

a) 16
b) 11
c) 13
d) 10

7. Which of the following is a valid variable name in C?


a) int-number
b) 2ndVariable
c) _value
d) #define

8. What does the sizeof() operator return?


a) The size of an integer variable
b) The size of a data type in bytes
c) The number of elements in an array
d) The length of a string

9. Which of the following is used to exit a loop prematurely?


a) continue
b) break
c) return
d) goto

10. What is the purpose of the void keyword?


a) To declare an empty variable
b) To specify a function that does not return a value
c) To initialize a null pointer
d) None of the above
Section B: Short Answer Questions

(Answer each question briefly. Each question carries 2 marks)


[10 Marks]

6. Write a program to check if a given number is even or odd.

7. Explain the difference between i-- and i++ with an example.

8. What are the main differences between arrays and functions in C?

9. Write the syntax of a for loop and explain each component.

10. Write a program to swap two numbers using a temporary variable.

Section C: Problem Solving

11. Write a program to calculate the factorial of a number entered by the user. Use recursion to
implement the solution.

You might also like