EES Study Material
EES Study Material
C Programming:
1. Developer of ‘C’ language is ______________
a. Dennis Richie b. Bill Gates c. Ken Thompson d. Peter Norton
2. C language developed in _________________
a. 1970 b. 1976 c. 1972 d. 1980
3. C is ______ level language
a. High b. Middle c. Low d. Machine
4. Which symbol is used for pre-processor statement?
a. ! b. # c. ~ d. ;
5. Which of the following is a scalar data type?
a. Float b. Array c. Union d. Pointer
6. Which of the following are tokens in C?
a. Keywords b. Constants c. Variables d. All of above
7. Which is the valid range of “int” data type?
a. 0 to 256 b. -32767 to +32768 c. -32768 to +32767 d. No particular range
8. Which symbol is used to terminate a statement?
a. ! b. # c. ~ d. ;
9. The operator && is used for ________.
a. Value assignment b. Logical comparison c. Increment by 1 d. Condition Checking
10. The operator & is used for _________.
a. Bitwise AND b. Pointer to the variable c. Logical AND d. None of these
11. Operator’s precedence determines which operator is ____________.
a. Faster b. Take no argument c. Take less memory d. Evaluated first
12. The bitwise AND is used for _______________.
a. Masking b. Division c. Comparison d. Shifting bits
13. The operator << is used for ________________.
a. Shifting bits to left b. Equality Checking c. Shifting bits to right d. None of these
14. Which of the following has the HIGHEST precedence?
a. * b. == c. => d. +
15. Integer Division results in ___________.
a. Truncating the fractional part c. Floating value
b. Rounding the fractional part d. An error is generated
16. Which is a Ternary Operator?
a. ? : b. * c. sizeof d. ^
17. The typecast operator is ____________.
a. cast () b. // c. (data type) d. “ ”
18. a+=4 means ____________
a. a=a+4 b. a=4 c. a+4=a d. a=4+4
19. p++ executes faster than p=p+1 because ______________________.
a. p uses registers b. p++ is a single instruction c. ++ is faster than + d. All of above
20. Header files in C contain ___________.
2
void main()
{
int count=1,digit=0;
while(digit<=9)
{
++count;
++digit;
}
printf(“%d”,count);
}
What will be the output?
a. 10 b. 9 c. 11 d. 12
32. Predict the output:
#include<stdio.h>
void main()
{
int i, j, k;
j=5;
i= 2*j/2;
k=2*(j/2);
printf("i=%d \n k=%d", i, k);
}
a. i=5, k=5 b. i=5, k=4 c. i=4, k=4 d. i=4, k=5
33. Predict the output:
#include<stdio.h>
void main()
{
int a, b, c;
a=2;
b=2*(a++);
c=2*(++a);
printf("b=%d \n c=%d",b,c);
}
a. b=4, c=6 b. b=3, c=8 c. b=3, c=6 d. b=4, c=8
{
if(i%5==0)
{
X++;
}
++i;
} while (i <20);
printf("X=%d",X);
}
What will be the output of this program?
a. X=4 b. X=20 c. X=25 d. X=10
35. What will be the output of the program:
#include<stdio.h>
void main()
{
int i=0, X=0;
while (i<20)
{
if(i%5==0) { X+=i; }
i++;
}
printf("X=%d", X);
}
a. X=30 b. X=20 c. X=25 d. X=10
36. What will be the output of the program:
#include<stdio.h>
void main()
{
int i, n=2;
for(i=0; i<2; i++)
{
if(!(i<=n) && (++n==i))
n=n+2;
else
n=n-2;
}
printf("n=%d",n);
}
a. 4 b. 3 c. 2 d. None of these
Arrays
5
Array in C is one of the most used data structures in C programming. Arrays are used to store
multiple values in a single variable, instead of declaring separate variables for each value.
Array Declaration
In C, we have to declare the array like any other variable before using it. We can declare an array by
specifying its name, the type of its elements, and the size of its dimensions. When we declare an array
in C, the compiler allocates the memory block of the specified size to the array name.
Syntax:
data_type arrayname[size]; or data_type arrayname [size1][size2]….[sizeN];
MCQ
Pseudocodes on Arrays:
1. What is the right way to initialize an array?
a. int num[6] = { 2, 4, 12, 5, 45, 5 }; c. int n{} = { 2, 4, 12, 5, 45, 5 };
b. int n{6} = { 2, 4, 12 }; d. int n(6) = { 2, 4, 12, 5, 45, 5 };
2. What will be the output of the program ?
#include <stdio.h>
void main()
{
int a[5] = { 5,1,15, 20,25},i,j,m;
i = ++a[1];
j = a[1]++;
m= a[i++];
printf(“%d%d%d”, i, j ,m);
}
a. 3,2,15 b. 2,3, 20 c. 2,1,15 d. 1,2,5
3. What will be the output of the program ?
#include <stdio.h>
void main()
{
char p;
char buf[10] = {1,2,3,4,5,6,9,8}
p = (buf +1) [5];
printf(“%d”, p);
}
b. 5 b. 6 c. 9 d. Error e. None of the above
4. An array elements are always stored in _____memory locations.
7
{
int a[] = {12,14,15,23, 45}
printf(“%u%u”, a, &a);
}
a. 65486, 65488 b. 65486, 65490 c. 65486, 65487 d. 65486, 65486
12. What will be the output of the program?
#include<stdio.h>
void main()
{
float a[] = {12.4,2.3,4.5,6.7}
printf(“%d”, sizeof(a)/sizeof(a[0]));
}
a. 5 b. 4 c. 6 d. 7 e. None of these
13. Which of the following is the correct syntax to access the 3rd element of an array arr?
a. arr[2] b. arr(3) c. arr.2 d. arr{3}
14. In C, arrays are _ indexed.
a. 1 b. 2 c. 0 d. Negative
15. What does the following code print?
#include <stdio.h>
int main()
{
int arr[3] = {5, 10, 15};
printf("%d", arr[1]);
}
a. 5 b. 10 c. 15 d. Error
20. What are the elements present in the array of the following int array[5] = {5};
a. 5, 5, 5, 5, 5 c. 5, (garbage), (garbage), (garbage), (garbage)
b. 5, 0, 0, 0, 0 d. (garbage), (garbage), (garbage), (garbage), 5
21. If integer requires 2bytes space, then what will be the size of the array int array[3][4]=(0);
a. 24 bytes b. 12 bytes c. 7 bytes d. 14 bytes
22. Consider the following declaration of an array int A[6] = {1,2,3,5}. Which of the following
statement is true?
a. Both A[2] and 2[A] represent the value 2
b. Both A[2] and 2[A] represent the value 3
c. A[2] is the correct way to access an element of A, but 2[A] will give an error.
d. The last two elements of the array A are 3 and 5
23. Consider the following array declaration:
int array1[]={2,3};
int array2[3]={9}
What will be the output of the following print statement?
printf(“%d%d”, array1[1],2[array2]);
a. 2,0 b. 3 0 c. 2 9 d. 3 9
24. What purpose does the following code serves
int main()
{
int array[] = {5, 3, 1, 9, 8, 2, 4, 7};
int size = sizeof(array)/sizeof(array[0]);
int i, j, min_idx,temp;
for (i = 0; i < size-1; i++)
{
min_idx = i;
for (j = i+1; j < size; j++)
{
if (array[j] < array[min_idx])
min_idx = j;
}
temp = array[min_idx];
array[min_idx] = array[i];
array[i] = temp; }
}
a. Finds some specific elements in the array c. Sort the elements of an array
b. Find the smallest element in the array d. None of the above
25. What will be output of the following program
int main()
{
int arr[4]={3,4,5,6};
10
int k[4];
k=arr;
printf(“%d\n”,k[1]);
}
String functions:
MCQ
1. What is string in c language?
a. String is a new Data Type in C
b. String is an array of Characters with null character as the last element of array.
c. String is an array of Characters with null character as the first element of array
d. String is an array of Integers with 0 as the last element of array.
2. Choose a correct statement about C String char ary[] =”Hello..!”
a. Character array, ary is a string.
b. ary has no Null character at the end
c. String size is not mentioned
d. String can not contain special characters.
3. What is the output of the following code?
int main()
{
char ary [] = “Discovery Channel”;
printf(“%s”, ary);
return 0;
}
12
{
int str [] = {‘g’,’l’,’o’,’b’,’e’};
printf(“A%c”, str);
printf(“A%s”, str);
printf(“A%c”, str[0]);
return 0;
}
a. AAA b. A Ag Ag c. A*randomchar* Ag Ag d. compile error
12. What is the output of the following code?
int main()
{
char str1[] = “JOHN”;
char str2[20] ;
str2=str1;
printf(“%s”, str2);
return 0;
}
a. JOHN b. J c. JOHN\0 d. Compile Error
13. What is the output of the code?
char str[] = "C Programming";
printf("%c", str[2]);
a. C b. P c. r d. Space
14. Which function is used to get the length of a string in C?
a. strlen() b. strlength() c.length() d. stringlen()
15. What will happen if you try to modify a string literal in C?
a. The program will crash.
b. The string literal will be modified.
c. The compiler will throw an error.
d. The program will display a warning at compile time.
16. What does the following code print?
char str[] = "Hello";
str[0] = 'J';
printf("%s", str);
a. Hello b. Jello c. J d. Error
A. 96 days
B. 144 days
C. 120 days
D. 80 days
Q1.2: Ajay and Vijay together can complete a job in 40 days, while Ajay alone can finish it in 60 days. How
many days will Vijay take to do the job alone?
A. 120 days
B. 100 days
C. 80 days
D. 90 days
Q2.1: Rohit and Sohan can complete a work in 10 and 15 days, respectively. They work together for 5 days,
and then Rohit leaves. How many more days will Sohan take to complete the remaining work?
A. 2 days
B. 3 days
C. 2.5 days
D. 5 days
Q2.2: Raj and Simran can finish a task in 8 and 12 days, respectively. They work together for 4 days, and then
Raj leaves. How many more days will Simran need to finish the remaining task?
15
A. 2 days
B. 3 days
C. 1.5 days
D. 2.5 days
Answer: A. 2 days
Q3.1: 6 men or 9 women can finish a job in 12 days. How many men must work with 18 women to complete
the job in 4 days?
A. 5 men
B. 6 men
C. 8 men
D. 7 men
Answer: B 6 men
Q3.2: 3 men or 6 women can finish a task in 10 days. How many men should work with 12 women to
complete the work in 3 days?
A. 4 men
B. 3 men
C. 2 men
D. 5 men
Answer: A. 4 men
Q4.1: 30 men can complete a task in 24 days. After 9 days, 20 more men join them. How many more days will
it take to finish the work?
A. 12 days
B. 10 days
C. 14 days
D. 9 days
Answer: D. 9 days
Q4.2: 60 workers can complete a job in 20 days. After 5 days, 40 additional workers join them. How many days
will it take to complete the remaining work?
A. 10 days
16
B. 8 days
C. 9 days
D. 7 days
Answer: C. 9 days
Q5.1: How many 3-digit odd numbers (with distinct digits) can you form using 0, 2, 3, 4, 5, 6?
A. 48
B. 60
C. 72
D. 32
Answer: D. 32
Q5.2: How many 4-digit even numbers (with distinct digits) can be formed using 1, 2, 3, 4, 5, 6?
A. 120
B. 180
C. 168
D. 192
Answer: B. 180
Q6.1: How many 6-letter words can be formed using the letters in "BANANA" if each letter can be used only
once?
A. 60
B. 420
C. 210
D. 120
Answer: A. 60
Q6.2: How many 7-letter words can be formed using the letters in "BALLOON" if each letter can be used only
once?
A. 420
B. 840
C. 5040
D. 1260
17
Answer: D. 1260
Q7.1: 8 people are to sit in a row. In how many ways can this be done if 3 specific people always sit together?
A. 120,960
B. 720
C. 4320
D. 60,480
Answer: C. 4320
Q7.2: 5 men and 4 women are to sit in a row. In how many ways can they be seated if all women must sit
together?
A. 17,280
B. 2,880
C. 362880
D. 12,960
Answer: A. 17280
Q8.1: The mean of 40 observations was 55. Later, it was found that an observation 75 was wrongly recorded
as 25. What is the correct mean?
A. 56.25
B. 55.75
C. 55.50
D. 56.00
Answer: A. 56.25
Q8.2: The mean of 25 observations was 64. It was later discovered that an observation recorded as 50 should
have been 80. What is the corrected mean?
A. 65.2
B. 64.8
C. 66.0
D. 65.6
Answer: A. 65.2
18
Q9.1: A batsman has an average of 50 runs after 6 innings. After his seventh inning, the average decreases to
48. How many runs did he score in the seventh inning?
A. 30
B. 36
C. 40
D. 44
Answer: B. 36
Q9.2: A cricketer has an average of 42 runs after 8 innings. In the ninth inning, his average drops to 40. How
many runs did he score in the ninth inning?
A. 24
B. 28
C. 30
D. 32
Answer: A. 24
Q10.1: The average age of 30 people is 40 years. 10 new people join, and their average age is 35 years. What
is the average age of the group now?
A. 38.75
B. 39.0
C. 39.5
D. 40.5
Answer: A. 38.75
Q10.2: The average age of a group of 20 people is 25 years. If 5 new members with an average age of 30 years
join, what is the average age of the new group?
A. 27
B. 26
C. 28
D. 29
Answer: B. 26
19
Q11.1: Two sugar solutions, A (30%) and B (50%), are mixed in the ratio 3:2. What is the concentration of the
resulting solution?
A. 38%
B. 40%
C. 42%
D. 45%
Answer: A. 38%
Q11.2: Two mixtures of alcohol and water have concentrations of 70% and 40%, respectively. If they are
mixed in the ratio 1:2, what is the concentration of alcohol in the final mixture?
A. 45%
B. 55%
C. 60%
D. 50%
Answer: D. 50%
Q12.1: A 40-liter solution contains 8% sugar. Another solution with 4% sugar is added. How many liters of the
second solution should be added to make the mixture 5% sugar?
A. 40 liters
B. 50 liters
C. 120 liters
D. 80 liters
Q12.2: A 60-liter solution has 10% alcohol. Another solution with 5% alcohol is added. How many liters of the
second solution should be added to create a mixture with 8% alcohol?
A. 30 liters
B. 40 liters
C. 50 liters
D. 60 liters
Answer: B. 40 liters
20
Q13.1: Milk and water are in the ratio 3:2 in one container and 5:4 in another. In what ratio should they be
mixed to get a mixture containing 7:6 milk and water?
A. 2:3
B. 3:4
C. 4:5
D. 5:18
Answer: D. 5:18
Q13.2: Two containers have milk and water in the ratios 7:5 and 3:2, respectively. In what ratio should these
mixtures be combined to get a final mixture with milk and water in the ratio 5:4?
A. 4:3
B. 3:2
C. 5:4
D. 8:5
Answer: D. 8:5
Pointing Rajesh in the photograph, Sunita said,’ The only son of his mother is my father’. How is
Sunita related to Rajesh?
A. Niece
B. Aunt
C. Mother
D. Daughter
Option D
Prema has a son named Anand. Rajiv is Prema’s brother. Neha has a daughter named Rashmi.
Neha is Rajiv’s sister. What is Anand’s relationship to Rashmi?
A. Nephew
B. Uncle
C. Brother-in-law
D. Cousin
Option D
There is a family of six members A, B, C, D, E and F. There are two married couples in the family
and the family members represent three generations. Each member has a distinct choice of a
colour amongst Green, Yellow, Black, Red, White and Pink. No lady member likes either Green or
White. C, who likes Black colour, is the daughter-in-law of E. B is the brother of F and son of D
and likes Pink. A is the grandmother of F and F does not like Red. The husband has a choice for
21
Option B
There is a family of six members A, B, C, D, E and F. There are two married couples in the family
and the family members represent three generations. Each member has a distinct choice of a
colour amongst Green, Yellow, Black, Red, White and Pink. No lady member likes either Green or
White. C, who likes Black colour, is the daughter-in-law of E. B is the brother of F and son of D
and likes Pink. A is the grandmother of F and F does not like Red. The husband has a choice for
green colour, his wife likes Yellow.
Which of the following is the colour combination of one of the couples?
A. Yellow-Red
B. Green-Black
C. Red-Yellow
D. Yellow-Green
Option D
Mr Rajat Chopra and his wife Nikita Chopra have 3 sons whose names are Ramesh, Suresh and
Umesh. Mishra family is a neighbour of the Chopra’s. Mr Amit Mishra and his wife Neha Mishra
have 2 daughters whose names are Payal and Ruchi. The two neighbouring families go to Kerala
for a vacation. They decided to go boating but no boat could carry more than 3 members. So
they hired 3 boats. None of the children knows how to row a boat, so at least one of the adults
has to be there on each boat. Moreover, no boat has all three members of the same family. If
Neha and Ruchi are on the same boat, which of the following could be a list of people on another
boat?
A. Ramesh, Amit, Payal
B. Ramesh, Suresh, Amit
C. Ramesh, Payal, Suresh
D. Amit, Payal, Nikita
Option B
In an organization of pollution control board, engineers are represented by a circle, legal
experts by a square and environmentalist by a triangle. Who is most represented in the board as
shown in the following figure?
22
A. Environmentalists
B. Legal Experts
C. Engineers with legal background
D. Environmentalists with engineering background.
Option: D
One morning after sunrise Juhi while going to school met Lalli at Boring Road crossing. Lalli's
shadow was exactly to the right of Juhi. If they were face to face, which direction was Juhi facing.
A. North
B. South
C. East
D. West
Option B
From his house, Lokesh went 15 kms to the North. Then he turned west and covered 10 kms.
Then he turned South and covered 5 kms. Finally, turning to East, he covered 10 kms. In which
direction is he from his house?
A. East
B. North
C. West
D. South
Option B
A boy rode his bicycle Northward, then turned left and rode 1 km and again turned left and rode
2 km. He found himself 1 km west of his starting point. How far did he ride northward initially?
A. 2 km
B. 4 km
C. 3 km
D. 5 km
Option A
23
Express 36 as rate percent:
23
8
A. 629 %
8
B. 639 %
C. 70%
8
D. 739 %
Option B
16.666% of 600 gm – 33.3333% of 180 gm
A. 40 grams
B. 35 grams
C. 25 grams
D. 22.5 grams
Option A
What percent of 6.5 litres is 130 ml?
A. 0.02%
B. 0.2%
C. 2%
D. 20%
Option C
Sixty five percent of a number is 21 less than four fifth of that number. What is the number?
A. 100
B. 120
C. 140
D. 200
Option C
In an election between two candidates, 75% of the voters cast their votes, out of which 2% of
the votes were declared invalid. A candidate got 9261 votes which were 75% of the total valid
votes. Find the total number of votes enrolled in that election.
A. 16800
B. 17500
C. 18000
D. 20000
24
Option A
Mr.Jones gave 40% of the money he had to his wife. he also gave 20% of the remaining amount
to his 3 sons. half of the amount now left was spent on miscellaneous items and the remaining
amount of Rs.12000 was deposited in the bank. how much money did Mr.jones have initially?
A. 10 lakhs
B. 1 lakh
C. 50,000
D. 65,000
Option B
Raj`s salary was decreased by 50% and subsequently increased by 50%.How much percent does
he lose or profit?
A. 25% loss
B. 25% profit
C. 5% profit
D. 5% loss
Option A
When the price of a product was decreased by 10%, the number sold increased by 30%. What
was the effect on the total revenue?
A. 20%
B. 25%
C. 17%
D. 15%
Option C
If A`s salary is 20% less then B`s salary, by how much percent is B`s salary more than A`s?
A. 20% more
B. 25% more
C. 16.666% more
25
D. 30% more
Option B
In an examination, 35% of total students failed in Hindi, 45% failed in English and 20% in both.
Find the percentage of those who passed in both subjects.
A. 20%
B. 30%
C. 40%
D. 60%
Option C
At what % above C.P must an article be marked so as to gain 33% after allowing a customer a
discount of 5%?
A. 10%
B. 20%
C. 30%
D. 40%
Option D
A man bought a horse and a cow for Rs 3000 together. He sold the horse at a gain of 20% and the
cow at a loss of 10%, thereby gaining 2% on the whole. find the cost of the horse.
A. 1000
B. 1200
C. 1250
D. 1300
Option B
A man brought toffees at for a rupee. How many for a rupee must he sell to gain 50%?
A. 10
B. 20
26
C. 5
D. 2
Option D
Ashok started walking towards South. After walking 50 metre, he took a right turn and walked
30 metre. He then took a right turn and walked 100 metre. He again took a right turn and walked
30 metre and stopped. How far and in which direction was he from
starting point?
A. 50 metre South
B. 150 metre North
C. 180 metre East
D. 50 metre North
Option D
Verbal:
Choose the correct form of the verb that agrees with the subject: