C Programming Mid Semester 2024
C Programming Mid Semester 2024
Section - A
Q1 (i) Which is valid C expression? [01]
a) int my_num = 100,000;
. b) int my_num = 100000;
c) int my num = 1000;
d) int $my_num = 10000;
(ii) Which of the following is NOT possible with any 2 operators in C? [01] CO1
a) Different precedence, same associativity
b) Different precedence, different associativity
c) Same precedence, different associativity
d) All of the mentioned
(iii) What is the significance of void data type? [01] CO1
(iv) scanf() is a predefined function in which header file. [01] CO1
(v) Evaluate the following expressions according to the precedence of C [01] CO1
language: exp = 100 + 200 / 10 - 3 * 10
Q2 What is the output of the following code?
. [02] CO3
(i)
(ii)
Page 1 of 2
[02] CO2
Section - B
Q3 Write a C program to find maximum between three numbers. [03] CO3
Q4 Write a C program to check whether a number is negative, positive or [03] CO4
zero.
Q5 Write a C program to input all sides of a triangle and check whether [03] CO5
triangle is valid or not.
Page 2 of 2