wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

C++ ECE Q1

Total questions: 55

Worksheet time: 41mins

Name
Class
Date
1.

What is the output of below C++ program?

a)

Hi

b)

Bye

c)

HiBye

d)

Compilation Error

2.

What following operator is called

?: in C++?

a)

Scope Resolution Operator

b)

Conditional Operator

c)

Ternary Operator

d)

if else o/p

3.
a)

11

b)

10

c)

Error

d)

0

4.
a)

Error

b)

5 times

c)

4 times

d)

6 times

5.
a)

10

b)

11

c)

Compilation Error

d)

Linking Error

6.

//What is the value of a in below C++ program?

int main()

{

int a, b=20;

a = 90/b;

return 0;

}

a)

4.5

b)

4.0

c)

4

d)

Compilation Error

7.
a)

10

b)

11

c)

12

d)

Error

8.

Which of the following is used for comments in C++?

a)

/* comment */

b)

// comment */

c)

// comment

d)

both // comment or /* comment */

9.
a)

111011

b)

111111

c)

101011

d)

101010

10.
a)

One

b)

Compilation Error

c)

Default

d)

OneTwoThreeDefault

11.
a)

Hello

b)

Bye

c)

Undefined

d)

Compilation Error

12.
a)

FiveSix

b)

Five

c)

Six

d)

None of these

13.
a)

Equal

b)

EqualEqual

c)

EqualNotEqual

d)

NotEqual

14.
a)

1010

b)

10

c)

infinitely print 10

d)

compile time error

15.

What will be the result of 10 / 3 in C++ when both operands are integers?

a)

3.33

b)

3

c)

0

d)

4

16.

Which of these is not a relational operator?

a)

<=

b)

!=

c)

>=

d)

&

17.

Which of these is a correct example of the increment operator in C++?

a)

a++

b)

++a

c)

a+=1

d)

All of the above

18.

Which of the following is the correct syntax for the ternary operator in C++?

a)

condition : expression1 ? expression2

b)

expression1 ? condition : expression2

c)

condition ? expression1 : expression2

d)

expression1 : condition ? expression2

19.

What will be the output of the following code:

int a = 5, b = 3;

cout << (a < b ? a : b);

a)

5

b)

3

c)

0

d)

Error

20.

What is the output of the following code?

int x = 10;

if (x > 5)

cout << "Hello";

a)

Hello

b)

Error

c)

Nothing

d)

10

21.

Output?

a)

35

b)

20

c)

25

d)

30

22.

Output?

a)

1000

b)

11

c)

1010

d)

1001

23.

Output?

a)

749735

b)

736749

c)

367497

d)

367597

24.

What are Binary Operators?

a)

Operators that work on two operands

b)

Operators that work on one operand

c)

Operators that work on three operands

d)

There is no such thing as Binary Operators

25.

What are Ternary Operators?

a)

Operators that work on three operands

b)

Operators that work on one operand

c)

Operators that work on two operands

d)

There is no such thing as Ternary operators

26.

What does this unary operator mean? : ++

a)

It is the increment operator, usage: x++ , output if x=10: 11

b)

It is the decrement operator, usage x--, output if x=10: 9

c)

It is the logical 'Not' operator, usage !(x), output if x=10: True

27.

What does this unary operator mean? --

a)

It is the decrement operator, usage: X--, output if x=10 : 9

b)

It is the increment operator, usage: x++, output if x=10 : 11

c)

It is the logical 'Not' operator, usage: !(X), output if x=10: True

28.

What does this unary operator mean? !

a)

It is the logical 'Not' operator, usage : !(X), output of x=10 : True

b)

It is the increment operator, usage : X++, output if x=10 : 11

c)

It is the decrement operator, usage : X--, output if x=10 : 9

29.

What does this arithmetic Binary operator mean? +

a)

Addition

b)

Multiplication

c)

Subtraction

d)

Remainder

30.

What does this arithmetic Binary operator mean? -

a)

Subtraction

b)

Addition

c)

Multiplication

d)

Division

31.

What does this arithmetic binary operator mean? *

a)

Multiplication

b)

Division

c)

Addition

d)

Subtraction

32.

What does this arithmetic binary operator mean? /

a)

Division

b)

Multiplication

c)

Fraction

d)

Subtraction

33.

What does this arithmetic binary operator mean? %

a)

Remainder

b)

Percentage

c)

Subtraction

d)

Multiplication

34.

What does this relational binary operator mean? ==

a)

Equal to

b)

Greater than

c)

Less than

d)

Greater than or equal to

35.

What does this relational binary operator mean? >

a)

Greater than

b)

Less than

c)

Greater than or equal to

d)

Less than or equal to

36.

What does this relational binary operator mean? <

a)

Less than

b)

Greater than

c)

Less than or equal to

d)

Greater than or equal to

37.

What does this relational binary operator mean? >=

a)

Greater than or equal to

b)

Less than or equal to

c)

greater than

d)

less than

38.

What does this relational binary operator mean? <=

a)

Less than or equal to

b)

Greater than or equal to

c)

Greater than

d)

Less than

39.

What does this relational binary operator mean? !=

a)

Not equal

b)

Wow! it equals to

c)

Less than or equal to

d)

Greater than or equal to

40.

Which is an example of a ternary operator?

a)

(condition)?(if_true):(If_false)

b)

?(if_true):(If_false)(condition)

c)

(condition)(condition)(if_true):(If_false)

41.

2 WORDS

(a)  

42.

(Time: 20s) Guess the word which fits all 4 images.(6 letters)


_ _ _ _ _ _

(a)  

43.

(Time: 20s) Guess the word which fits all 4 images.(8 letters)

_ _ _R L _ _ _

(a)  

44.

(Time: 20s) Guess the word which fits all 4 images.(5 letters)

F _ _ _ _

(a)  

45.

(Time: 20s) Guess the word which fits all 4 images.(9 letters)

_ _ _ _ _ T _ _ _

(a)  

46.

(Time: 20s) Guess the word which fits all 4 images.(4 letters)

_ _ _ _

(a)  

47.

(Time: 30s) Spot all the differences between the 2 images.

Mention the number of differences in the answer.

Eg.: 3 or three

(a)  

48.

(Time: 20s) Spot all the differences between the 2 images.

Mention the number of differences in the answer.

Eg.: 3 or three

(a)  

49.

(Time: 20s) Solve this.

(a)  

50.

(Time: 10s) Pick the odd one out

a)

A

b)

B

c)

C

d)

D

51.

(Time: 20s) Guess the Disney movie name(3 words)


_ _ _ / _ _ _ _ _ _ / _ _ _ _

(a)  

52.

(Time: 10s) Guess the ice cream parlor name (2 words)

(a)  

53.

(Time: 10s) Guess the Disney movie name.(1 word)

(a)  

54.

(Time: 10s) Guess the hidden word

(a)  

55.

(Time: 5s) Which is correct logo A or B ?

(a)