wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

PSPD_CCA1

Total questions: 20

Worksheet time: 24mins

Name
Class
Date
1.

C programs are converted into machine language with the help of

a)

an Editor

b)

an operating system

c)

compiler

d)

None of the above

2.

Which of the following is not a

correct variable type?

a)

float

b)

int

c)

double

d)

real

3.

Which is the only function all C

programs must contain?

a)

start()

b)

main()

c)

system()

d)

printf()

4.

C variable cannot start with

a)

An alphabet

b)

A number or special symbol other than underscore

c)

Uppercase alphabet

d)

None of the above

5.

What will be printed after execution of the following program code?

main()

{

printf("\nab");

printf("\nsi");

printf("\tha");

}

a)

absiha

b)

ab

si ha

c)

haasi

d)

None of these

6.

What will be the output of the program code?

int main()

{

int a = 5;

int b = 10;

int c = a+b;

printf("%i",c);

}

a)

0


b)

15

c)

compiler error

d)

undefined

7.

What should be the output:

int main()

{

int a = 10/3;

printf("%d",a);

}

a)

3.33

b)

3.00

c)

3

d)

0

8.

What should be the output:

int main()

{

int a = 10.5;

printf("%d",a);

}

a)

10.5

b)

10

c)

0.5

d)

0

9.

Which of the following operator takes only integer operands?

a)

+

b)

/

c)

*

d)

%

10.

What is the function of escape sequence'\n'

a)

Horizontal tab

b)

Backspaace

c)

Newline

d)

Single quote

11.

format specifier for float type data is

a)

%f

b)

%d

c)

%c

d)

%lf

12.

what is the use function printf()

a)

accepting input from input device

b)

displaying data on output device

c)

both a and b

d)

None of the above

13.

++x is which type of operator

a)

post decrement

b)

pre increment

c)

post increment

d)

pre decrement

14.

Decrement operator '--' returns value of variable

a)

subtracted value of variable by 1

b)

subtracted value of variable by 2

c)

added value of variable by 1

d)

None of the above

15.

following is the logical operator in 'C'

a)

'++'

b)

'<<'

c)

'&&'

d)

'/'

16.

what is the use of pow(x,y) function

a)

calculate x*y

b)

calculate x/y

c)

calculate x^y

d)

calculate x-y

17.

# define pi 3.14 is used -------globally

a)

value of pi constant

b)

value of variable pi

c)

both a and b

d)

None of the above

18.

Space required in memory to store integer data is-----byte

a)

1 byte

b)

3 byte

c)

4 byte

d)

2 byte

19.

above shape is used in flowchart

a)

for start and stop

b)

to indicate operation

c)

to take decision

d)

to perform input or output opertion

20.

Determine the value of following expression if a=7,b= 3

a%b

a)

2.33

b)

2

c)

1

d)

21