Computer Programming (3310701) MCQs

MCQs of Operators and Expression

Showing 41 to 49 out of 49 Questions
41.

What will be the output of the following C code?

void main()
{
        int h = 8;
        int b = 4 * 6 + 3 * 4 < 3 ? 4 : 3;
        printf("%d\n", b);
}

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

void main()
{
        int h = 8;
        int b = 4 * 6 + 3 * 4 < 3 ? 4 : 3;
        printf("%d\n", b);
}

(a)

3

(b)

33

(c)

34

(d)

Run time error

Answer:

Option (a)

42.

In C, which of the following type of operators have the highest precedence?111

C માં, નીચેના માંથી કયા ઓપરેટર  ની precedence સૌથી વધુ  છે?

(a)

Relational

(b)

Logical

(c)

Bitwise

(d)

Arithmetic

Answer:

Option (d)

43.

The '&' operator displays _________. 

'&' ઓપરેટર _________ ડિસ્પ્લે કરે છે.

(a)

Address of the variable

વેરીએબલ નું એડ્રેસ

(b)

Value of the variable

વેરીએબલ ની વેલ્યુ

Answer:

Option (a)

44.

The result of 16>>2 is ________ .

16>>2 નું રિઝલ્ટ ________ .

(a)

4

(b)

8

(c)

2

(d)

5

Answer:

Option (a)

45.

From the below which operator is used in arithmetic operations?

Arithmetic operations માં કયા ઓપરેટરનો ઉપયોગ થાય છે?

(a)

Logical Operator

(b)

Increment Operator

(c)

Assignment Operator

(d)

Conditional Operator

Answer:

Option (c)

46.

If a=8 and b=15 then the statement 

x=(a>b)?a:b;

(a)

assigns a value 8 to x

(b)

gives an error message

(c)

assigns a value 15 to x

(d)

assigns a value 7 to x

Answer:

Option (c)

47.

Guess the output of following program

x=5;
y=x++;
printf("%d,%d",x,y);

આપેલા પ્રોગ્રામ નું આઉટપુટ શું હશે?

x=5;
y=x++;
printf("%d,%d",x,y);

(a)

5,6

(b)

5,5

(c)

6,5

(d)

6,6

Answer:

Option (c)

48.

The minimum number of temporary variables needs to swap the contents of two variables is _________ .

બે વેરીએબલ ના content ને swap કરવા માટે ઓછામાં ઓછા કેટલા temporary વેરીએબલ ની જરૂર પડે છે?

(a)

0

(b)

1

(c)

2

(d)

3

Answer:

Option (a)

49.

Guess the output of following program

b=s+b;
s=b-s;
b=b-s;

આપેલા પ્રોગ્રામ નું આઉટપુટ શું હશે?

b=s+b;
s=b-s;
b=b-s;

(a)

transfer the contents of s to b

s નો કન્ટેન્ટ b માં ટ્રાન્સફર કરી આપે છે

(b)

transfer the contents of b to s

b નો કન્ટેન્ટ s માં ટ્રાન્સફર કરી આપે છે

(c)

exchange the contents of s and b

s અને b નો કન્ટેન્ટ સ્વેપ કરી આપે છે

(d)

negate the contents of s and b

s અને b ની વેલ્યુ નેગેટ કરી આપે છે

Answer:

Option (c)

Showing 41 to 49 out of 49 Questions