wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Basics Of C Programming

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

Which header file can be used to define input/output function prototypes and macros?

a)

- math.h

b)

- memory.h

c)

- stdio.h

d)

- dos.h

2.

The correct order of evaluation for the expression “z = x + y * z / 4 % 2 – 1”

a)

* / % = + -

b)

/ * % - + =

c)

- + = * % /

d)

* / % + - =

3.

How many times CppBuzz.com is printed?

int main()

{

int a = 0;

while(a++);

{

printf("CppBuzz.com");

}


return 0;

}

a)

0 time

b)

1 time

c)

Compilation Error

d)

Infinite times

4.

How many times CppBuzz.com is printed on console?

int main()

{

int a = 0;

while(a++)

{

printf("CppBuzz.com");

}


return 0;

}

a)

Nothing is printed on screen

b)

0 time

c)

1 time

d)

Infinite times (Untill Stack overflow)

5.

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

return 0;

}

a)

55

b)

54

c)

1

d)

0

6.

What is output of below program?


int main()

{

int i;

for(i=0; i<5; ++i++)

{

printf("Hello");

}

return 0;

}

a)

Hello is printed 5 times

b)

Compilation Error

c)

Hello is printed 2 times

d)

Hello is printed 3 times

7.

What is an Identifier in C Language.?

a)

Name of a Function or Variable

b)

Name of a Macros

c)

Name of Structure or Union

d)

All the above.

8.

Find an integer constant.

a)

3.145

b)

34

c)

"125"

d)

None of the above

9.

Number of Keywords present in C Language are .?

a)

32

b)

34

c)

62

d)

64

10.

Each statement in a C program should end with.?

a)

Semicolon ;

b)

Colon :

c)

Period . (dot symbol)

d)

None of the above.