wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

C-Programming

Total questions: 30

Worksheet time: 15mins

Name
Class
Date
1.

How many main() function we can have in a program

a)

1

b)

2

c)

No Limit

d)

None

2.

How many loop are there in C

a)

2

b)

3

c)

1

d)

4

3.

When is C Language was invented

a)

1970

b)

1972

c)

1978

d)

1979

4.

Library function getch() belongs to which header file?

a)

stdio.h

b)

conio.h

c)

stdlib.h

d)

none

5.

which of the following ways can be used to include header file in C program

a)

#include"stdio.h"

b)

#include<stdio.h>

c)

both

d)

none

6.

What are Parameter passing techniques available in C Language

a)

Call by value

b)

Call by reference

c)

Both

d)

None

7.

Array is collection of elements of

a)

Dis-similarity Data Types

b)

Similar Data Types

c)

Both

d)

None

8.

structures are collection of elements of

a)

Dis-similarity Data Types

b)

Similar Data Types

c)

Both

d)

None

9.

what are the basic data types in C Language

a)

int , float

b)

int , float , char

c)

int, float, char , double

d)

int, char, double

10.

Arithmetic operators available in C Language are

a)

+ , -, *, / , %

b)

+ , -, *, / , <

c)

+ , -, *, ==, <=

d)

&&, ||, ==, >=

11.

Pointer variable is to hold

a)

int value

b)

float value

c)

Address

d)

None

12.

Examples of unconditional statements

a)

goto , continue

b)

goto, continue, break

c)

break, continue

d)

goto break

13.

Conditional statements are

a)

Simple if , if-else , else-if, switch

b)

Simple if , if-else , else-if, while

c)

Simple if , do-while , else-if, switch

d)

Simple if , if-else , do-while , for

14.

Program execution starts from

a)

#include

b)

main()

c)

Other sub-functions

d)

None

15.

Conditional operator (? :) is a

a)

Unary Operator

b)

Binary Operator

c)

Ternary Operator

d)

All

16.

Examples for Unary operators

a)

% , /

b)

==, &&

c)

<= , >=

d)

++ , --

17.

What is output for:

a=5;

printf("%d", a++) ;

a)

5

b)

6

c)

4

d)

0

18.

What is the Output:

int a=5;

printf("%d", ++a);

a)

5

b)

6

c)

7

d)

4

19.

What is the output:

int i;

printf("%d", i);

a)

0

b)

Garbage value

c)

1

d)

Error

20.

What is the Output:

int a=5,b=6,c=2;

printf("%d", a+b*c);

a)

17

b)

22

c)

11

d)

Error

21.

What is the Output :

void main()

{

int a=5,b=6,k;

k=b>a?b:a;

printf("%d",k);

}

a)

5

b)

6

c)

11

d)

Error

22.

what is the output:

void main()

{

int a=5;

a+=2;

printf("%d",a);

}

a)

7

b)

5

c)

6

d)

Error

23.

What is the Output:

void main()

{

int a=4, b=2,c;

c=a*b;

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

}

a)

4, 2, 8

b)

2, 4, 8

c)

4, 8, 2

d)

2, 8, 4

24.

what is the Output:

void main()

{

int a=3,b=6;

if(a>b)

printf("%d",a);

else

printf("%d",b);

}

a)

3

b)

6

c)

Compilation Error

d)

Run Time Error

25.

What is the technique name for the following Function call swap():

void main()

{

swap(3,7)

}

a)

Call by value

b)

Call by reference

c)

Both

d)

None

26.

What is the Keyword used to define a Structure

a)

Structure

b)

Static

c)

Dynamic

d)

Struct

27.

which of the following is Address operator

a)

&&

b)

&

c)

||

d)

==

28.

"goto" statement is:

a)

Conditional statement

b)

Assignment statement

c)

Declaration statement

d)

Unconditional statement

29.

Which of the following is a Unary Operator

a)

&&

b)

||

c)

<

d)

!

30.

C language was developed by

a)

B. Stroustrup

b)

James Gosling

c)

Anders Hejlsberg

d)

Dennis M.Ritchie