Sample MID Exam Questions
Sample MID Exam Questions
if (type == ‘A’)
interest = bal * 0.25;
Select one:
a. 0.00
b. 1000.00
c. 3500.00
d. 13500.00
e. 11000.00
2. Consider the below C structure which represents the groups in an institute. studentCount represents the no
of students in a given group.
struct group
{
int groupNo;
int studentCount;
}group1, group2;
There are 115 students in group1 and 123 students in group2. Which of the following C statements will correctly
assign these student counts?
Select one:
a. group. studentCount = 115; group. studentCount = 123;
b. group1. studentCount = 115; group2. studentCount = 123;
c. studentCount = 115; studentCount = 123;
d. group1 = 115; group2 = 123;
e. int studentCount1 = 115; int studentCount2 = 123;
The correct answer is: group1. studentCount = 115; group2. studentCount = 123;
3. Which of the following X value will yield the below expression to ‘True’?
( X < (X + 1) ) && (X == 8)
Select one:
a. 10
b. Any integer
c. 1
d. 8
e. None of the above
Select one:
a. 1-2-4-5
b. 5-4-2-1
c. 1000-100-10-1
d. 1-10-100-1000
e. None of the above
Select one:
a. total , 1num , average_mark , _total
b. total salary , average , num1
c. totalMark , salary , num_one , average
d. int , num , salary , total
e. mark , total , average , $count
c. A C compiler translates the source code into object code line by line.
<stdio.h> is a header file with predefined functions like printf, scanf etc,
A program can be compiled and executed without the header file <stdio.h>
#include is a PreprocessorDirective
if ( sum <= 20 )
sum = sum + 5;
else
sum = sum - 5;
Select one:
a. value = 30
b. value = 15
c. value = 20
d. value = 10
e. value = 35
char letter;
Select one:
a. Alphabetical characters and numeric values only
b. Any character
c. Lowercase alphabetical characters only
d. Numeric values only
e. Uppercase and lowercase alphabetical characters only