Computer Programming (3310701) MCQs

MCQs of Operators and Expression

Showing 1 to 10 out of 49 Questions
1.

Which operator is used to find reminder after division?

ડિવિઝન પછી રિમાઇન્ડર શોધવા માટે કયા ઓપરેટરનો ઉપયોગ થાય છે?

(a)

*

(b)

/

(c)

-

(d)

%

Answer:

Option (d)

2.

Which operator has higher priority while evaluating arithmetic expression?

એરીથમેટિક એક્સપ્રેશન ને ઇવેલ્યુએટ કરતી વખતે કયા ઓપરેટરને હાયર પ્રાયોરિટી આપવામાં આવશે?

(a)

+

(b)

-

(c)

%

(d)

All have same priority

બધાની પ્રાયોરિટી સમાન છે

Answer:

Option (c)

3.

Which is the symbol for logical OR operator?

લોજિકલ OR ઓપરેટર નો સિમ્બોલ કયો છે?

(a)

!=

(b)

&

(c)

&&

(d)

||

Answer:

Option (d)

4.

Which opeartor is unary?

આપેલા માંથી કયું ઓપરેટર યુનરી છે?

(a)

*

(b)

/

(c)

+

(d)

%

Answer:

Option (c)

5.

What is the output of following code?

void main()
{
         int x = 15,y;
         y = x++;
         printf("%d %d",++y,x++);
}

આપેલા કોડનું આઉટપુટ શું છે?

void main()
{
         int x = 15,y;
         y = x++;
         printf("%d %d",++y,x++);
}

(a)

15 16

(b)

1616

(c)

16 16

(d)

16 15

Answer:

Option (c)

6.

Which one is correct syntax of ternary operator?

ટર્નરી ઓપરેટરની સાચી સીન્ટેક્ષ કઈ છે?

(a)

expr1?expr2:expr3;

(b)

expr1?expr2::expr3;

(c)

expr1=expr2:expr3;

(d)

expr1:expr2?expr3;

Answer:

Option (a)

7.

What is value of z for following code?

આપેલા કોડ માટે z ની વૅલ્યુ શું છે?)

int y=8,z;
z = y>>2;

(a)

8

(b)

2

(c)

4

(d)

1

Answer:

Option (b)

8.

Which operators have right to left associativity?

કયા ઓપરેટર્સની અસોસીએટીવીટી લેફ્ટ ટુ રાઈટ છે?

(a)

Arithmetic

એરીથમેટીક

(b)

Relational

રીલેશનલ

(c)

Assignment

અસાઈન્મેન્ટ

(d)

Conditional

કંડીશનલ

Answer:

Option (c)

9.

5-3*4+6/4 evaluates to

(a)

5

(b)

-6

(c)

3.5

(d)

10

Answer:

Option (b)

10.

4*(3+6)-(4+3) evaluates to

(a)

8

(b)

29

(c)

11

(d)

5

Answer:

Option (b)

Showing 1 to 10 out of 49 Questions