wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

FDS quiz 2

Total questions: 20

Worksheet time: 12mins

Name
Class
Date
1.

What is the output of C Program.?

int main()

{

int a=25;

while(a <= 27)

{

printf("%d ", a);

a++;

}

return 0;

}

a)

25 25 25

b)

25 26 27

c)

27 27 27

d)

Compiler error

2.

Choose a right C Statement.

a)

Loops or Repetition block executes a group of statements repeatedly.

b)

Loop is usually executed as long as a condition is met.

c)

Loops usually take advantage of Loop Counter

d)

All the above.

3.

What is the way to suddenly come out of or Quit any Loop in C Language.?

a)

continue; statement

b)

break; statement

c)

leave; statement

d)

quit; statement

4.

Choose a correct C for loop syntax.

a)

for(initalization; condition; incrementoperation) { //statements }

b)

for(declaration; condition; incrementoperation) { //statements }

c)

for(declaration; incrementoperation; condition) { //statements }

d)

for(initalization; condition; incrementoperation;) { //statements }

5.

Choose a correct C do while syntax.

a)

dowhile(condition) { //statements }

b)

do while(condition) { //statements }

c)

do { //statements }while(condition)

d)

do { //statements }while(condition);

6.

C programs are converted into machine language with the help of

a)

An Editor

b)

A compiler

c)

An operating system

d)

None of these.

7.

Which of the following is not a correct variable type?

a)

float

b)

real

c)

int

d)

char

8.
The keyword used to transfer control from a function back to the calling function is
a)
switch
b)
goto
c)
go back
d)
return
9.
If the two strings are identical, then strcmp() function returns
a)
-1
b)
1
c)
0
d)
yes
10.
How will you print \n on the screen?
a)
printf("\n");
b)
echo "\\n";
c)
printf('\n');
d)
printf("\\n");
11.
Functions cannot return more than one value at a time
a)
True
b)
False
12.

The process of removing a bug is known as

a)

Debugging

b)

Compilation

c)

Executing

d)

Running

13.

Which of the following is the boolean operator for logical-AND?

a)

&

b)

&&

c)

|

d)

||

14.

Which of the following is not a valid variable name declaration?

a)

int a3;

b)

int 3a;

c)

int _A3;

d)

int a_3

15.

All keywords in C are in ____________

a)

Lowercase

b)

Uppercase

c)

Camelcase

d)

None of these

16.

Which is variable declaration?

a)

int a,b;

b)

c=a+b;

c)

printf("%d%d",a,b)

d)

scanf("%d%d",&a,&b);

17.
Which symbol terminates a C statement?
a)
.
b)
;
c)
,
d)
}
18.

#include<stdio.h> is important line in c. The stdio.h contains information on input output routines.

a)

True

b)

False

19.

Library function pow() belongs to which header file?

a)

mathio.h

b)

math.h

c)

square.h

d)

stdio.h

20.

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");

}

a)

hi

b)

hello

c)

no

d)

error