wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

C Revision Test Basic To Structure

Total questions: 57

Worksheet time: 57mins

Name
Class
Date
1.

Which of the following are themselves a collection of different data types?

a)

String

b)

Struct

c)

char

d)

all

2.

Which operator connects the structure name to its member name?

a)

-

b)

=

c)

.

d)

>>

3.

Which of the following cannot be a structure member?

a)

another structure

b)

array

c)

Function

d)

None

4.

What do you understand by:

void update(struct student *s);

a)

update is a function that takes an argument as pointer to structure variable and returns nothing

b)

update is a method that takes structure type variable as parameter

c)

Error, we cannot pass structure variable as pointer to a function

d)

update takes pointer argument but it cannot return void

5.

_______________to be included to use standard I/O functions : prinf(),scanf()

a)

#include<conio.h>

b)

#include<stdio.h>

c)

#include<string.h>

d)

#include<math.h>

6.

Blank spaces can be used while declaring a variable, keyword, constant and function.

a)

True

b)

False

7.

The user can also write one or more statements in one line by separating semicolon (;)

a)

True

b)

False

8.

The opening and closing braces should be balanced.

a)

True

b)

False

9.

A variable is an entity whose value ____________ during the execution of a program

a)

can change

b)

cannot change

10.

Which is correct example for variable declaration?

a)

int a;b;c;

b)

Int a,b,c;

c)

int a,b,c;

d)

int a,b;c;

11.

What are the Relational operators?

a)

<< , >>

b)

+, -, !, ~, ++, - -, &, sizeof

c)

*, /, %

d)

<, <=, >, >=

12.

The sizeof operator returns the size of its operand in bytes

a)

True

b)

False

13.

Address-of Operator is used to find the address of a data object. Example: &a

a)

True

b)

False

14.

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

a)

1

b)

2

c)

No Limit

d)

None

15.

How many loop are there in C

a)

2

b)

3

c)

1

d)

4

16.

Library function getch() belongs to which header file?

a)

stdio.h

b)

conio.h

c)

stdlib.h

d)

none

17.

What are Parameter passing techniques available in C Language

a)

Call by value

b)

Call by reference

c)

Both

d)

None

18.

Array is collection of elements of

a)

Dis-similarity Data Types

b)

Similar Data Types

c)

Both

d)

None

19.

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

20.

Arithmetic operators available in C Language are

a)

+ , -, *, / , %

b)

+ , -, *, / , <

c)

+ , -, *, ==, <=

d)

&&, ||, ==, >=

21.

Pointer variable is to hold

a)

int value

b)

float value

c)

Address

d)

None

22.

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

23.

Program execution starts from

a)

#include

b)

main()

c)

Other sub-functions

d)

None

24.

Conditional operator (? :) is a

a)

Unary Operator

b)

Binary Operator

c)

Ternary Operator

d)

All

25.

Examples for Unary operators

a)

% , /

b)

==, &&

c)

<= , >=

d)

++ , --

26.

What is output for:

a=5;

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

a)

5

b)

6

c)

4

d)

0

27.

What is the Output:

int a=5;

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

a)

5

b)

6

c)

7

d)

4

28.

What is the output:

int i;

printf("%d", i);

a)

0

b)

Garbage value

c)

1

d)

Error

29.

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

30.

what is the output:

void main()

{

int a=5;

a+=2;

printf("%d",a);

}

a)

7

b)

5

c)

6

d)

Error

31.

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

32.

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

33.

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

34.

What is the Keyword used to define a Structure

a)

Structure

b)

Static

c)

Dynamic

d)

Struct

35.

"goto" statement is:

a)

Conditional statement

b)

Assignment statement

c)

Declaration statement

d)

Unconditional statement

36.

Which of the following is a Unary Operator

a)

&&

b)

||

c)

<

d)

!

37.

Structure mean ------------?

a)

Same data types

b)

Different data types

c)

Both a and b

d)

None of these

38.

4. Name the one which is not a looping statement

a)

for

b)

while

c)

do-while

d)

if

39.

Constant is ------------------

a)

Fixed values

b)

Unknown values

c)

Values changes during execution

d)

None of these

40.

Every C statement ends with ------------?

a)

.

b)

;

c)

,

d)

}

41.

----------------- are used in C programming to manipulate the data at bit level

a)

Logical operator

b)

Bitwise operator

c)

Additional operators

d)

None of the above

42.

In switch statement Case Labels must ends with --------

a)

;

b)

:

c)

,

d)

}

43.

while loop is a --------------------------- loop.

a)

Entry-controlled

b)

Exit-controlled

c)

Not controlled

d)

None of these

44.

do-while loop performs the test at the ------------- of the loop

a)

top

b)

bottom

c)

middle

d)

None of these

45.

---------- and ------------ are the two frequent operations on arrays.

a)

Searching and sorting

b)

Decrementing and decrementing

c)

Searching and incrementing

d)

none of these

46.

We can initialize a two-dimensional array in the form of ---------

a)

Searching

b)

increment

c)

matrix

d)

none of these

47.

The two dimensional array is

a)

int

b)

struct

c)

matrix

d)

none of these

48.

Structure keyword is -------------

a)

struct

b)

array

c)

main

d)

none of these

49.

A sequence of instructions form a ------------.

a)

syntax

b)

program

c)

both

d)

none of these

50.

The continue statment cannot be used with

a)

for

b)

while

c)

do while

d)

switch

51.

goto can be used to jump from main to within a function?

a)

true

b)

false

c)

-

d)

-

52.

Which loop is guaranteed to execute at least one time.

a)

for

b)

while

c)

do while

d)

none of the above

53.

What will be the output of the following C code?

#include <stdio.h>

int main()

{

do{

printf("In while loop ");

}while (0);

printf("After loop\n");

}

a)

In while loop

b)

In while loop after loop

c)

After loop

d)

Infinite loop

54.

#include <stdio.h>

int main()

{

int i = 0;

do {

i++;

printf("in while loop\n");

} while (i < 3);

}

a)

2

b)

3

c)

4

d)

1

55.

What will be the output of the following C code?

#include <stdio.h>

int main()

{

int i = 0;

do

{

printf("Hello");

} while (i != 0);

}

a)

Nothing

b)

H is printed infinite times

c)

Hello

d)

Run time error

56.

#include<stdio.h>

int main()

{

int i;

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

printf("%d ",i);

}

a)

0 1 2 3 4 5 6 7 8 9

b)

Compile Error

c)

Run Time Error

d)

10

57.

Is it possible to run program without main() function?

a)

yes

b)

no

c)

-

d)

-