Computer Programming (3310701) MCQs

MCQs of Operators and Expression

Showing 11 to 20 out of 49 Questions
11.

Which of the following expression uses bitwise operator?

નીચેનામાંથી ક્યુ એક્ષપ્રેશન બીટવાઇઝ ઓપરેટરનો ઉપયોગ કરે છે?

(a)

a++

(b)

!a>5

(c)

a|b

(d)

a!=b

Answer:

Option (c)

12.

What will be the output of following code?

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

x=5;y=x>3? 10 : 20;

(a)

10

(b)

20

(c)

5

(d)

3

Answer:

Option (a)

13.

Which of the following is wrong expression?

નીચેનામાંથી કયું એક્ષપ્રેશન ખોટું છે?

(a)

j=j+1;

(b)

j+=1;

(c)

j++;

(d)

j=+1;

Answer:

Option (d)

14.

If a=8, b=2 and c=-5, then what is the value of the arithmetic expression : 2*b+3*(a-c)

જો a = 8, b = 2 અને c = -5, તો પછી આપેલા એરીથમેટિક એક્ષપ્રેશન ની વેલ્યુ શું હશે:  2 * b + 3 * (a-c)

(a)

43

(b)

6

(c)

-16

(d)

-1

Answer:

Option (a)

15.

What will be the output of following program?

નીચે આપેલા પ્રોગ્રામનું આઉટપુટ શું છે?)

int i=2,j=4,k;
float a,b;
k= i/j*j;
a= i/j*j;
b= j/i*i;
printf("%d%d%f",k,a,b);

(a)

2 2 4

(b)

004.0

(c)

442

(d)

0 0 4.0

Answer:

Option (b)

16.

What will be the output of following program?

નીચે આપેલા પ્રોગ્રામનું આઉટપુટ શું છે?)

int a=5,b;
a++;
b=a++;
b++;
b=++a;
printf("%d %d",a,b);

(a)

8 8

(b)

6 7

(c)

7 6

(d)

5 8

Answer:

Option (a)

17.

Which of the following operator has the highest precedence?

નીચેનામાંથી કયા ઓપરેટરની પ્રેસીડન્સી હાઈયેસ્ટ હોય છે?

(a)

*

(b)

==

(c)

=>

(d)

+(Unary)

Answer:

Option (d)

18.

The associativity of ! Operator is ________ .

! ઓપરેટર ની એસોશિએટિવિટી _________ છે.

(a)

Right to left

રાઈટ ટુ લેફ્ટ 

(b)

Left to right

લેફ્ટ ટુ રાઈટ

Answer:

Option (a)

19.

Which operator has the lowest priority?

કયા ઓપરેટરની પ્રાયોરિટી લોવૅસ્ટ છે?

(a)

++

(b)

%

(c)

+

(d)

||

Answer:

Option (d)

20.

Which operator has the highest priority?

કયા ઓપરેટરની પ્રાયોરિટી સૌથી હાઈયેસ્ટ છે?

(a)

++

(b)

%

(c)

+

(d)

||

Answer:

Option (a)

Showing 11 to 20 out of 49 Questions