wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

C Programing

Total questions: 25

Worksheet time: 19mins

Name
Class
Date
1.

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.

2.

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

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.

Loops in C Language are implemented using.?

a)

While Block

b)

For Block

c)

Do While Block

d)

All the above

5.

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 }

6.

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

7.

Who is Father of C Language

a)

Bjarne Stroustrup

b)

James A. Gosling

c)

Dennis Ritchie

d)

Dr. E.F. Codd

8.

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.

9.

Which is the only function all C programs must contain?

a)

start()

b)

system()

c)

printf()

d)

main()

10.

Which of the following is not a correct variable type?

a)

float

b)

real

c)

int

d)

char

11.
The keyword used to transfer control from a function back to the calling function is
a)
switch
b)
goto
c)
go back
d)
return
12.
If the two strings are identical, then strcmp() function returns
a)
-1
b)
1
c)
0
d)
yes
13.
How will you print \n on the screen?
a)
printf("\n");
b)
echo "\\n";
c)
printf('\n');
d)
printf("\\n");
14.
In C, if you pass an array as an argument to a function, what actually gets passed?
a)
Value of elements in array
b)
First element of the array
c)
Base address of the array
d)
Address of the last element of array
15.
Functions cannot return more than one value at a time
a)
True
b)
False
16.
A preprocessor directive is a message from programmer to the pre-processor.
a)
True
b)
False
17.

The process of removing a bug is known as

a)

Debugging

b)

Compilation

c)

Executing

d)

Running

18.

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

a)

&

b)

&&

c)

|

d)

||

19.

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

a)

int a3;

b)

int 3a;

c)

int _A3;

d)

int a_3

20.

All keywords in C are in ____________

a)

Lowercase

b)

Uppercase

c)

Camelcase

d)

None of these

21.

Diamond shaped symbol is used in flowcharts to show the-

a)

decision box

b)

statement box

c)

error box

d)

if-statement box

22.

Which is variable declaration?

a)

int a,b;

b)

c=a+b;

c)

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

d)

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

23.
Which symbol terminates a C statement?
a)
.
b)
;
c)
,
d)
}
24.

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

a)

True

b)

False

25.

Library function pow() belongs to which header file?

a)

mathio.h

b)

math.h

c)

square.h

d)

stdio.h