Computer Programming (3310701) MCQs

MCQs of Operators and Expression

Showing 31 to 40 out of 49 Questions
31.

!=   is the example of ____________________ operator.

!= એ _________ ઓપરેટર નું ઉદાહરણ છે.

(a)

Relational

રીલેશનલ

(b)

Logical

લોજિકલ

(c)

Assignment

અસાઈન્મેન્ટ

(d)

Conditional

કન્ડીશનલ

Answer:

Option (a)

32.

The _____________ operator checks if the values of two operands are equal or not.

_____________ ઓપરેટર ચેક કરે છે કે બે ઓપરેન્ડ્સની વેલ્યુ સમાન છે કે નહીં.

(a)

= =

(b)

=

Answer:

Option (a)

33.

The modulus operator (%) can be used only with integers.

મોડ્યુલસ ઓપરેટર (%) નો ઉપયોગ ફક્ત ઈંટીજર સાથે જ થઈ શકે છે.

(a)

TRUE

(b)

FALSE

Answer:

Option (a)

34.

What will be the output of the following C code?

void main()
{
        int i = -3;
        int k = i % 2;
        printf("%d",k);
}

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

void main()
{
        int i = -3;
        int k = i % 2;
        printf("%d",k);
}

(a)

2

(b)

-1

(c)

1

(d)

-3

Answer:

Option (b)

35.

According to operator precedence, which of the following is correct for the arithmatic operators ?

ઓપરેટર ની precedence પ્રમાણે નીચે માં માંથી કયું ઓપ્શન એરીથમેટીક ઓપરેટર માટે સાચું છે ?

(a)

%, *, /, +, –

(b)

%, +, /, *, –

(c)

+, %,-, *, /

(d)

%, /, +, *, -

Answer:

Option (a)

36.

Which of the following is not an arithmetic operation?

નીચેનામાંથી ક્યુ એરિથમેટિક ઓપરેશન નથી?

(a)

a * = 10;

(b)

a / = 10;

(c)

a ! = 10;

(d)

a % = 10;

Answer:

Option (c)

37.

What will be the output of the following C code?

void main()
{
        int k = 8;
        int m = 7;
        int z = k < m ? k++ : m++;
        printf("%d", z);
}

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

void main()
{
        int k = 8;
        int m = 7;
        int z = k < m ? k++ : m++;
        printf("%d", z);
}

(a)

7

(b)

8

(c)

Error

(d)

15

Answer:

Option (a)

38.

Associativity of an operator can be  ___________ .

ઓપરેટરની એસોસિએટીવીટી ___________ પ્રકારની હોય છે.

(a)

Right to Left

રાઈટ ટુ લેફ્ટ

(b)

Left to right

લેફ્ટ ટુ રાઈટ

(c)

Random

(d)

Both Right to Left and Left to Right

રાઈટ ટુ લેફ્ટ અને લેફ્ટ ટુ રાઈટ બન્ને

Answer:

Option (d)

39.

Which of the following method is true for assignment?

નીચેનીમાંથી કઈ મેથડ અસાઇન્મેન્ટ માટે સાચી છે?

(a)

a=5;
int a;

(b)

int a;
a=5

(c)

int a,b=5;

(d)

int b;
a=5;

Answer:

Option (c)

40.

Which of the following operators has the lowest precedence?

નીચેનામાંથી કયા ઓપરેટરની સૌથી ઓછી precedence છે?

(a)

!=

(b)

&&

(c)

?:

(d)

,

Answer:

Option (d)

Showing 31 to 40 out of 49 Questions