wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

ES084 Final Exam

Total questions: 50

Worksheet time: 25mins

Name
Class
Date
1.

Which of the following is an invalid assignment operator?

a)

A%=10;

b)

A/=10;

c)

A|=10

d)

none

2.

Who is the father of C-Language?

a)

Steve Jobs

b)

James Gosling

c)

Dennis Ritche

d)

Rasmus Lerdorf

3.

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

a)

int number;

b)

float _rate;

c)

int variable_Count;

d)

int $main;

4.

#include<stdio.h>

int main(){

int x=10;

float y = 5.6;

int c;

int z;

z = x+y;

printf("Value of z is %d", z);}

What is the value of "z" in this code?

a)

The value of z is 10

b)

The value of z is 15

c)

The value of z is 15.6

d)

The value of z is 16

5.

What will be the output of this code?

a)

OK

b)

KO

c)

Depends on compiler

d)

Depends on standard

6.

All keywords in C are ________.

a)

lowercase

b)

uppercase

c)

Camelcase

d)

None of these

7.

How to write a single line comment?

a)

/* Comment */

b)

/* Comment

c)

//Comment//

d)

//Comment

8.

_________used to give tab spaces in c programming.

a)

/n

b)

\t

c)

/t

d)

\n

9.

The program that translates your code from a high-level language to the binary language is called ________.

a)

programmer

b)

compiler

c)

translator

d)

linker

10.

scanf() is a predefined function of _______ header file.

a)

stdlib.h

b)

conio.h

c)

stdio.h

d)

stdarg.h

11.

Which of the following is correct identifier?

a)

int

b)

1ab

c)

a_123

d)

a 123

12.

what is the output of the following statement?

printf("hi\nhello\nhow\tare\ryou");

a)

hi

hello

how are

you

b)

hi

hello

how

are

you

c)

hi

hello

youre

d)

hi

hello

youare

13.

The C-preprocessors are specified with _________ symbol.

a)

$

b)

#

c)

&

d)

*

14.

What will be the final value of x in the following C code?

#include <stdio.h>

void main()

{

int x = 5 * 9 / 3 + 9;

}

a)

3.75

b)

24

c)

3

d)

15

15.

What will be the output of the following C code?

#include <stdio.h>

void main()

{

int y = 3;

int x = 5 % 2 * 3 / 2;

printf("Value of x is %d", x);

}

a)

Value of x is 1

b)

Value of x is 3

c)

Value of x is 1.5

d)

Error

16.

What will be the output of the following C code?

#include <stdio.h>

int main()

{

int a = 10;

double b = 5.6;

int c;

c = a + b;

printf("%d", c);

}

a)

15.6

b)

15

c)

16

d)

10

17.

What will be the output of the following C code?

#include <stdio.h>

void main()

{

int x = 1, y = 0, z = 5;

int a = (x && y) || (z++);

printf("%d", z);

}

a)

error

b)

5

c)

6

d)

0

18.

Which among the following is NOT a logical opearator?

a)

&&

b)

||

c)

!

d)

!=

19.

What will be the output of the following C code?

#include <stdio.h>

void main()

{

int h = 8;

int b = h++;

printf("%d%d\n", b, h);

}

a)

8 8

b)

8 9

c)

9 9

d)

9 8

20.

The ______ symbol denotes decision making in flowchart?

a)

b)

c)

d)

21.

The ______ symbol used for input/ output operation in flowchart?

a)
b)
c)
d)
22.

What is the output of this program?

#include <stdio.h>

void main()

{

printf("hello\world\n");

printf("hello\n\nworld\n");

}

a)

hello world

hello

world

b)

hello

world

hello

world

c)

hello

world

hello

world

d)

hello\world

hello

world

23.

What is the output of the following code?

void main()

{

int i=1;

i=2+2*i++;

printf("%d",i);

}

a)

2

b)

3

c)

4

d)

5

24.

C is called ______ level programming language

a)

Low Level

b)

High Level

c)

Middle

d)

NONE

25.

what will be output of ....


printf("%d",10+5/2);

a)

7.5

b)

7

c)

12

d)

12.5

26.

what will be output of....


printf(" %d ", 5.6 / 2.3);

a)

2.5

b)

2.2

c)

2.8

d)

0

27.

the % (modulus) can be used with _____ data type

a)

double

b)

float

c)

int

d)

char

28.

logical operators are used for......

a)

developing conditions

b)

combining conditions

c)

using conditions

d)

none of the above

29.

what will be output of following code?

int a=25;

int b=a / 10 % 10;

printf("%d",b);

a)

25

b)

5

c)

2

d)

20

30.

what wil be output of .....

a=5; b=10;

a=a+b;

b=a-b;

a=a-b;

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

a)

a=5 b=10;

b)

a=10 b=10

c)

a=5 b=5

d)

a=10 b=5

31.

what will be output of following code:


int a;

printf("%d",&a);

a)

display garbage value

b)

display address of a

c)

display 5

d)

none of the above

32.

printf("%d",08);will display....

a)

8

b)

08

c)

10

d)

error

33.

if(a>b)

printf("hi");

else;

printf("hello");


if given input is 15 & 10 what will be output?

a)

hi

b)

hello

c)

hi hello

d)

ERROR

34.

if(a>b);

printf("a is big");

else

printf(" b is big");

if input is 5 & 10 what is output?

a)

5

b)

10

c)

5 10

d)

error

35.

The operator == is a

a)

Conditional operator

b)

Bitwise operator

c)

Mathematical operator

d)

Logical operator

36.

Determine the output/result of the conditional expression below give the values:

a = 5, b = 8; c=8; d=3


((a+d)==b) && (c==b)

a)

True

b)

False

37.

Determine the output/result of the conditional expression below give the values:

a = 5, b = 8; c=8


(a%2==0) && (c>a)

a)

True

b)

False

38.

Determine the output/result of the conditional expression below give the values:

a = 5, b = 8; c=8


(a>b) && (c<a)

a)

True

b)

False

39.

Determine the output/result of the conditional expression below give the values:

a = 5, b = 8; c=8


(a>b) || (c<a)

a)

True

b)

False

40.

Determine the value of out for the following code snippet below:


int num = 45, n = 2.3;

float out;

out = num/n;

a)

19.565217

b)

19

c)

22

d)

22.00

41.

Determine the value of out for the following code snippet below:


int num = 45, n = 2.3, out;

out = num/n;

a)

19.565217

b)

19

c)

22

d)

22.00

42.

Determine the value of out for the following code snippet below:


int n = 64, m = 5, out;

out = n%m;

a)

4

b)

4.0

c)

12

d)

Error

43.

A type of conditional structure that executes inside the body of if, only if the controlling condition is true, otherwise it will skip it and executes the statements inside the else.

a)

if-else-if

b)

nested if

c)

if-else

d)

if

44.

A type of conditional statements best used for a problem with multiple checkpoints.

a)

if-else-if

b)

nested if

c)

if-else

d)

if

45.

The minimum possible number of times a while loop can be executed.

a)

0

b)

1

c)

cannot be predicted

d)

depends on the compiler

46.

A type of conditional statements best used for a problem with multiple alternatives.

a)

if-else-if

b)

nested if

c)

if-else

d)

if

47.

Given these integer values:

A = 12, B = 16, C = 8, D = 8, E = 21, F = -12, G = -7


Evaluate:


((A<B) && (C>=D) && (F>G))

a)

True

b)

False

48.

Given these integer values:

A = 12, B = 16, C = 8, D = 8, E = 21, F = -12, G = -7


Evaluate:


( !(B>D) || (!(C==D)&&(F<G)))

a)

True

b)

False

49.

Given these integer values:

A = 12, B = 5, C = 18, D = 8, E = 21, F = -12, G = -7


Evaluate:


!((A%D)>=B) || ((E/B)<B)

a)

True

b)

False

50.

Given these integer values:

A = 12, B = 5, C = 18, D = 8, E = 21, F = -2, G = 2


Evaluate:

(((E/B)%2)==0)

a)

True

b)

False