retagged by
776 views

1 Answer

Best answer
3 3 votes



precedence

*,/,%  L->R

+,-    L->R

 

  • A) i+5%j-2+k

i+1-2+k

= 2-2+k

= 0+k
= 3

  • B) i * 5 / j - 2 + k

5/j-2+k
= 2-2+k
= 0+k
= 3

  • C) i +5% j +2 /k

i+1+2/k
= i+1+0
= 2

  • D) i * 5% j -2/ k

i*5 %2 -2/k
=5%2 - 2/k
= 1 - 2/3

= 1 - 0

= 1

So, answer is option C .

selected by
Answer:
Position:
Show:

Related questions

0 0 votes
1 answers 1 answer
794
794 views
Bikram asked May 14, 2017
794 views
Spot the error(s) in this code snippet :int n=2; // Line 1 switch(n) { case 1.5: printf( "gate"); break; case 2: printf( "overflow"); break; case 'A': printf("gateoverflo...
0 0 votes
1 1 answer
612
612 views
Bikram asked May 14, 2017
612 views
Read the following code fragment:#include <stdio.h main() { int i=1,j; int k= 1__ (j ___ i) ; printf("%d%d%d\n", i,j,k); }What operators are needed in the blanks to print...
0 0 votes
1 1 answer
590
590 views
Bikram asked May 14, 2017
590 views
#include<stdio.h int K = 10; int main() { foo(); foo(); return 0; } int foo() { static int k= 1; printf("%d ",k); k++; return 0; }What is the output of the above code sni...
0 0 votes
1 1 answer
551
551 views
Bikram asked May 14, 2017
551 views
What is the output of the following program? int fun (int z) { if( z==0 || z==1 ) return 1; else return fun(z-1) ; } int main() { int y; y=fun(8); printf(“%d”, y)...