Font size
WorksheetsAptitude and Logical
Total questions: 136
Worksheet time: 2hrs 33mins
The continue statment cannot be used with
for
while
do while
switch
In the following loop construct, which one is executed only once always.
for(exp1; exp2; exp3)
exp1
exp3
exp1 and exp3
exp1,exp2 and exp3
What will be the output of the following C code?
#include <stdio.h>
int main()
{
int i = 0;
do
{
printf("Hello");
} while (i != 0);
}
Nothing
H is printed infinite times
Hello
Run time error
#include <stdio.h>
int main()
{
int i = 0;
while (i < 3)
{
i++;
printf("In while loop\n");
}
}
2
3
4
1
Is it possible to run program without main() function?
yes
no
-
-
What is the output of C Program.?
int main()
{
int a=5;
while(a >= 3);
{
printf("RABBIT\n");
break;
}
printf("GREEN");
return 0;
}
GREEN
RABBIT GREEN
RABBIT is printed infinite times
None of the above
What is the output of C Program.?
int main()
{
int a=25;
while(a <= 27)
{
printf("%d ", a);
a++;
}
return 0;
}
25 25 25
25 26 27
27 27 27
Compiler error
What is the output of C Program.?
int main()
{
int a=32;
do
{
printf("%d ", a);
a++;
}
while(a <= 30);
return 0;
}
32
33
30
No Output
What is the output of C Program.?
int main()
{
int k;
for(k=1; k <= 5; k++);
{
printf("%d ", k);
}
return 0;
}
1 2 3 4 5
1 2 3 4
6
5
Choose correct C while loop syntax.
while(condition) { //statements }
{ //statements }while(condition)
while(condition); { //statements }
while() { if(condition) { //statements } }
What is the output of C Program.?
int main()
{
int a=5;
while(a=123)
{
printf("RABBIT\n");
break;
}
printf("GREEN");
return 0;
}
GREEN
RABBIT GREEN
RABBIT is printed unlimited number of times.
Compiler error.
int main()
{
int a = 10, b = 25;
a = b++ + a++;
b = ++b + ++a;
printf("%d %d n", a, b);
}
36 64
35 62
36 63
30 28
int main()
{
char arr[7]="Network";
printf("%s", arr);
return 0;
}
Network
N
Garbage Value
Compilation error
int main ()
{
int x = 24, y = 39, z = 45;
z = x + y;
y = z - y;
x = z - y;
printf ("n%d %d %d", x, y, z);
}
24 39 63
39 24 63
24 39 45
39 24 45
int main() {
int m = -10, n = 20;
n = (m < 0) ? 0 : 1;
printf("%d %d", m, n);
}
-10 0
10 20
20 -10
0 1
int main() {
int x = 0, y = 0;
if(x > 0)
if(y > 0)
printf("True");
else
printf("False");
}
No Output
True
False
Error because of dangling else problem
#include<stdio.h>
int main()
{
int a=2,b=7,c=10;
c=a==b;
printf("%d",c);
}
0
7
2
Compilation error
Who is Father of C Language
Bjarne Stroustrup
James A. Gosling
Dennis Ritchie
Dr. E.F. Codd
C Language is developed at ___________?
AT & T's Bell Laboratories of USA in 1972
AT & T's Bell Laboratories of USA in 1970
Sun Microsystems in 1973
Cambridge University in 1972
C programs are converted into machine language with the help of
An Editor
A compiler
An operating system
None of these.
Which one of the following is not a valid identifier?
_examveda
1examveda
exam_veda
examveda1
int main ()
{
int x = 24, y = 39, z = 45;
z = x + y;
y = z - y;
x = z - y;
printf ("%d %d %d", x, y, z);
}
24 39 63
39 24 63
24 39 45
39 24 45
The process of removing a bug is known as
Debugging
Compilation
Executing
Running
Every C Program Statement must be terminated with a
.
#
;
!
How many choices are possible when using a single if-else statement?
1
2
3
4
What does the following code fragment write to the monitor?
Under
Over
Under the limit
Over the limit
What does the following code fragment write to the monitor?
Under
Over
Under the limit
Over the limit
What does the following code fragment write to the monitor?
You win
You lose
You win the prize.
You lose the prize.
What does the following code fragment write to the monitor?
You win
You lose
You win the prize.
You lose the prize.
In if-else, else block execute when
"if expression" return true
"if expression" return false
"else expression" return true
"else expression" return false
Which of the following is the boolean operator for logical-AND?
&
&&
|
||
Which of the following is not a valid variable name declaration?
int a3;
int 3a;
int _A3;
int a_3
All keywords in C are in ____________
Lowercase
Uppercase
Camelcase
None of these
Diamond shaped symbol is used in flowcharts to show the-
decision box
statement box
error box
if-statement box
Which is correct with respect to size of the data types?
char > int > float
int > char > float
char < int < double
double > char > int
Which is valid C variable declarations?
int my_num = 100,000;
int my_num = 100000;
int my num = 1000;
int $my_num = 10000;
The functions printf() and scanf() are defined in which of the following library file:-
math.h
conio.h
stdio.h
stdlib.h
#include <stdio.h>
void main()
{
int k = 4;
float k = 4;
printf("%d", k)
}
A.
4
4.000000
No output
Compile time Error
how to print a and b variable of int and float respectively
scanf("%d%f",&a,&b);
printf("%d%f",a,b);
printf("%f%d",&a,&b);
printf("%f%d",&a,&b);
When applied to a variable, what does the unary "&" operator yield?
The variable's address
The variable's right value
The variable's binary form
The variable's value
The operator "&" is used for
Bitwise AND
Bitwise OR
Logical AND
Logical OR
Which are built-in data structures in C programming?
Arrays
Structures
Files
All of the above
The size of a character variable in C is
8 bytes
4 bytes
2 bytes
1 byte
Which is the correct sequence statements that swaps values of two statements?
a=a+b; a=a-b; b=a-b;
a=a+b, b=a-b; a=a-b;
a=a-b; a=a+b; b=b-a;
None of these
The words if, else, auto, float etc. have predefined meaning and users cannot use them as variables.
These words are called
keywords
identifier
data types
constant
While assigning a value to a variable, which operators are used to perform arithmetic operations?
Logical operator
Assignment operator
Increment operator
Conditional opertor
Program is a list of_______________, written in a _______________________ to determines the behaviour of a machine.
word, english
instructions , programming language
instructions, word
C programming consists of two section which are _________________ and ___________________
Pre-processor directives ; Main function
Pre-processor directives ; end statement
statements ; Main function
Process of writing the C source code is called as ___________________
Editing
LInking
Executing
#include<stdio.h> is important line in c. The stdio.h contains information on input output routines.
True
False
An Integrated Development Environment typically consists of:
A text editor
A compiler
A debugger
All of these
___ is used to translate source code instructions into the appropriate machine language instructions
Module
Library routine
Compiler
Preprocessor directives
Computer programs are also known as:
Hardware
Firmware
Software
Silverware
The primary purpose of an operating system is:
To make the most efficient use of the computer hardware
To make programming easier
To fetch instructions
To prevent multitask
What is the extension of C program source code?
.cpp
.py
.c
.java
What is machine language?
A language used by car
Machine language is made of 1's and 0's
Machine language is made of 7's and 8's
A language that only understands plain English
Which of the following is not a high level programming language?
Assembly
C++
Java
Python
What is the value of this expression using integer arithmetic:
7 / 4
1
2
1.75
Determine the value of this expression using integer arithmetic:
5 % 7
0
2
5
Determine the value of b in this code fragment:
int a=3, b;
b=++a;
3
4
2
What will be printed on the screen from this fragment:
int num=0;
printf("%d", ++num)
0
1
2
What is the abbreviated way to write this assignment statement:
total=total+num;
t=t+n;
total+=num
total=(total+num)
%s indicates in scanf statement
to get an integer
to get a character
to get a string
to get a real no.
What percentage of the world is on social media?
20%
50%
70%
90%
Where was Netflix founded?
India
America
England
Japan
What is the word or phrase that does not belong in each group?
What is the word or phrase that does not belong in each group?
Find the least number which when divided by 5,7,9 and 12, leaves the same remainder 3 in each case
1236
1263
1623
1632
35 x 11
485
375
385
365
5, 10, 15, 20, 25, ____, ____, ____
30, 35, 40
65, 35, 116
26, 27, 28
20, 15, 10
16, 11, 6, 1
What would come next in the pattern shown?
327, 333, 339, ____, 351, 357
600, 550, _______, ________, 400, 350, 300, 250, 200
500, 400
350, 500
450, 500
500, 450
23, 33, ___, 53, ___, 73
4, 12, 20, 28, 36,...
What is the equation for the function
y = 2x+3
an = 3 (.5)n-1
an = 3 (2)n-1
an = 1.5 (2)n-1
Multiple personality
Mirror personalities
Split personality
Double personality
Daytime Entertainment
TV's No Good
Nothing Good On TV
TV Under No Good
CNN
Sad when this happens
Forgotten Hero
Gots left Heroes
Heroes Write Gots
Left four Hero ten
It Only Gets...
& Better times two
& Better & Better
Bigger & Better
This & Better
Blue Mo Once On
Moon only Once
Once in a Blue Moon
Moon over Miami
Generate Arrow
Down Between R and A
Generation Gap
Blue Arrow Gener Ation
Two APPOINTed
A POINT beside A POINT
Up to A POINT
Too FUNNY for WORDS
Two FUNNY over four WORDS
Funniest Words
3+3=8
7+7=?
You find me in December, but not in any other month. What am I?
Christmas
Winter
Hanukkah
The letter D
What goes up but not down
Your Age
Your dog
your laugh
Air
If it takes 5 machines 5 minutes to make 5 T-shirts, how long will it take 100 machines to make 100 T-shirts?
100 minutes
50 minutes
5 minutes
20 minutes
When the alarm sounded, the ______ at the party changed from festive to terrifying.
Ambiance
Ballistics
Aptitude
Chronic
to improve
disposition
vague
chastisement
enhance
Study the chart and answer the questions: The pie
chart given here represents the domestic expenditure of a family in percent.Study the chart and answer the following questions if the total monthly income of the family is Rs. 33,650.
The house rent per month is:
Rs. 6000
Rs. 6152
Rs. 6057
Rs. 6048
Study the chart and answer the questions: The pie chart given here represents the domestic expenditure of a family in percent. Study the chart and answer the following
questions if the total monthly income of the family is Rs. 33,650.
After providential fund deductions and payment of house rent, the total monthly income of the family remains:
Rs. 23545
Rs. 24435
Rs. 23555
Rs. 25355
An______________ is someone who provides a product or service for someone else for money.
entrepreneur
aptitude
consumer
A person or organization that pays people to work for them
employer
employee
co worker
a skill you have already developed
ability
aptitude
interests
