WorksheetsPPS Quiz 2
Total questions: 48
Worksheet time: 25mins
Computer Language ...
is a form of symbolic language that must be translated to machine language
are used to code or program a system or software in the computer.
is a primary language that understood by the computer.
Compilation also can be known as a translation process that convert other languages to
Computer Language
Assembly Language
Machine Language
High-Level Language
__________ is a group of instructions that perform a specific task
Function
Standard instruction
Identifiers
Reserved word
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
Choose a correct C for loop syntax.
for(initalization; condition; incrementoperation) { //statements }
for(declaration; condition; incrementoperation) { //statements }
for(declaration; incrementoperation; condition) { //statements }
for(initalization; condition; incrementoperation;) { //statements }
Who is Father of C Language
Bjarne Stroustrup
James A. Gosling
Dennis Ritchie
Dr. E.F. Codd
Which of the following is the boolean operator for logical-AND?
&
&&
|
||
Diamond shaped symbol is used in flowcharts to show the-
decision box
statement box
error box
if-statement box
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
Choose correct Syntax for C Arithmetic Compound Assignment Operators.
a+=b is (a= a+ b)
a-=b is (a= a-b)
a*=b is (a=a*b)
a/=b is (a = a/b)
a%=b is (a=a%b)
All the above.
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
#include<stdio.h>
int main()
{
char arr[11]="The African Queen";
printf("%s",arr);
}
The African Queen
The
The African
Compilation error
Predict output of following program
int main(){
int i;
int arr[5] = {1};
for (i = 0; i < 5; i++)
printf("%d ", arr[i]);
return 0;
}
1 1 1 1 1
1 followed by 4 junk values
1 0 0 0 0
Compiler error
a=2;b=6; (a<b):10:15
10
15
2
6
Equivalent of switch statement
If
if-else
elseif ladder
while
What is output of below program?
int main()
{
int i,j,count;
count=0;
for(i=0; i<5; i++);
{
for(j=0;j<5;j++);
{
count++;
}
}
printf("%d",count);
}
55
54
1
0
Which one of the following is a loop construct that will always be executed once?
for
while
switch
do while
What will the result of 'num' variable after execution of the following statements?
int num = 58;
num % = 11;
3
5
8
11
Choose a right C Statement.
Loops or Repetition block executes a group of statements repeatedly.
Loop is usually executed as long as a condition is met.
Loops usually take advantage of Loop Counter
All the above.
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=32;
do
{
printf("%d ", a);
a++;
if(a > 35)
break;
}
while(1);
return 0;
}
No Output
32 33 34
32 33 34 35
Compiler error
What is the output of C Program.?
int main()
{
int k;
for(printf("FLOWER "); printf("YELLOW "); printf("FRUITS "))
{
break;
} return 0;
}
Compiler error
FLOWER FRUITS
FLOWER YELLOW
FLOWER YELLOW FRUITS
To print out 'a' as an integer and 'b' as a decimal, which of the following printf() statement will you use?
printf("%f %lf", a, b)
printf("%f %f", a, b)
printf("%d %f", a, b)
printf("%f %d", a, b)
Which of the following is not logical operator?
&
&&
||
!
Which of the following is not a correct variable type?
int
real
float
char
Which of the following is the correct operator to compare two variables?
equal
=
:=
==
What is the only function all C programs must contain?
start()
system()
main()
Program()
The "\n" character does which of the following operations?
Double line spacing
Character deletion
Character backspace
Places cursor on the next line
C programs are converted into machine language with the help of
An Editor
A compiler
An operating system
None of these.
What will be the output of the following C code?
#include <stdio.h>
void main()
{
int x = 5;
if (x < 1)
printf("hello");
if (x == 5)
printf("hi");
else
printf("no");
}
hi
hello
no
error
How many loops are there in C
1
3
2
4
Which of the following is an exit control statement
for
while
do while
continue
Every C Program Statement must be terminated with a
.
#
;
!
What is output of below program?
void main()
{
const int a = 10;
printf("%d",++a);
}
11
10
Compilation Error
0
What is the only thing that computers understand?
Machine Code
Low Level Language
High Level Language
Algorithm
Java, Python, PHP, and C++ are examples of
low level languages
Graphic arts languages
medium level languages
high level languages
What is machine code?
A programming language that a computer understands
The make and model of a computer
The serial number of a computer
Which of these is the set of rules that must be followed when typing code using a programming language?
Syntax
Value
Expression
Statement
The Unary operator is -----------------------------
>>
++
<<
==
Case label in switch() should not be -----------------------
floating point
integer
long integer
all above
Every switch() statement should have one ------------- label
default
while
for
all above
---------------- statement should be the last statement in each case in switch() statement
break()
case
goto
until
1 GB is equal to ------------
1024KB
1024 Byte
1024MB
1024 nano
%f specifies ---------------- data type
float
int
char
string
