C Operator Questions

Hello PrepSter,

If you find any errors in the quiz below kindly comment in the comment section and we will make it our priority to fix it.

Also if you have a better of the solution to the questions, please do comment them below and if we find it better than ours, we will post it in our website.

Question 1

Time: 00:00:00
What is the expected outcome od the following C code ?

#include "stdio.h" void fst(void) { printf("Prep"); } void snd(void) { printf("Insta"); } int main() { fst(), snd(); return 0; }

Prep, Insta

Prep, Insta

Prep Insta

Prep Insta

Error because of the , between the fst() and snd()

Error because of the , between the fst() and snd()

PrepInsta

PrepInsta

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 2

Time: 00:00:00
Choose the correct option for the following code.

#include <stdio.h> int main() { int arr[7]; int n=3; arr[++n]=n++; printf("%d",arr[n]); printf(" %d",n); return 0; }

4 5

4 5

3 4

3 4

4 4

4 4

Compiler dependent

Compiler dependent

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 3

Time: 00:00:00
What will be the out of the code below ?

#include <stdio.h> void main() { int skip; skip = 26; skip = skip >>4; skip = skip <<6; printf("The decimal value of skip is %d",skip); printf(" The Octadecimal value of skip is %o",skip); }

The decimal value of skip 0 The Octadecimal value of skip is 0

The decimal value of skip 0 The Octadecimal value of skip is 0

The decimal value of skip 26 The Octadecimal value of skip is 32

The decimal value of skip 26 The Octadecimal value of skip is 32

The decimal value of skip 64 The Octadecimal value of skip is 100

The decimal value of skip 64 The Octadecimal value of skip is 100

Error because of incorrect use of << and >> operators.

Error because of incorrect use of << and >> operators.

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 4

Time: 00:00:00
Choose the option equivalent to the statement

a=a+1;

b=b-1;

c=a+b+c+d;

d=d+1;

c=a+b+d+1;

c=a+b+d+1;

c=(a++) + (b--) + (d++)

c=(a++) + (b--) + (d++)

c=(++a) + (b--) + d+1

c=(++a) + (b--) + d+1

c=(++a) + (--b) + (d++)

c=(++a) + (--b) + (d++)

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 5

Time: 00:00:00
What is the disadvantage of loop unrolling ?

 

Increases program efficiency.

Increases program efficiency.

Increases program code size.

Increases program code size.

If statements in loop are independent and can be performed in parallel.

If statements in loop are independent and can be performed in parallel.

Reduces loop overhead.

Reduces loop overhead.

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 6

Time: 00:00:00
What would be the output of the following code below ?

#include <stdio.h> void main() { int a,b,c,d,e; a=4; b=2; c=1; d=4; e=1; int g; g=++a==(b++)*c+d-e; printf("%d",g); }

5

5

1

1

0

0

Compilation error

Compilation error

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 7

Time: 00:00:00
What is the correct output of the following C code ?

#include <stdio.h> int main() { int i= 11 ,12 ,13; printf("%d",i); return 0; }

11 12 13

11 12 13

11

11

13

13

Compliation error

Compliation error

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 8

Time: 00:00:00
Select the correct output of the code below.

#include <stdio.h> int main() { int i=(11,12,13); printf("%d",i); return 0; }

11

11

13

13

(null)

(null)

Compilation error

Compilation error

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 9

Time: 00:00:00
What is the expected output of the given code ?

#include <stdio.h> int main() { int i; i=11,12,13; printf("%d",i); return 0; }

11

11

13

13

11,12,13

11,12,13

Compilation error

Compilation error

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 10

Time: 00:00:00
Which is the options is the correct output of the given code ?

#include <stdio.h> int fun(int *a, int *b) { int sum; sum=*a; *a=*b; *b=sum; return *a; } int main() { int i = 0, j = 9, k = 6, l; l = i++ || fun(&j, &k); printf("%d %d %d %d", i, j, k, l); return 0; }

1 1 9 1

1 1 9 1

1 9 6 1

1 9 6 1

11 6 1

11 6 1

1 6 9 1

1 6 9 1

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

["0","40","60","80","100"]
["Need more practice!","Keep trying!","Not bad!","Good work!","Perfect!"]