adplus-dvertising
frame-decoration

Question

What will be the output of the following program?
#include <stdio.h>
main()
{
   int a=1, b=3;
   b= a++ + a++ + a++ + a++ + a++;
   printf("a=%d \n b=%d",a,b); 
}

a.

a = 6, b = 15

b.

a =1 , b = 3

c.

a = 1 , b =15

d.

a = 2 , b = 4

Posted under Compiler Design

Answer: (a).a = 6, b = 15

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What will be the output of the following program?

Similar Questions

Discover Related MCQs

Q. Which of the following operators has the highest precedence?

Q. If i=1 j=2,k=3, then what is the value of the expression
!((j + k) > (i + 5))

Q. The expression 5 – 2 – 3 * 5 – 2 will evaluate to 18, if – is left associative and

Q. Coercion

Q. Which of the following operators takes only integer operands ?

Q. Pick the operators that associate from the left

Q. Pick the operators that associate from the right

Q. Pick the operators that associate from left to right

Q. What is the index number of the last element of an array with 29 elements?

Q. Which of the following is a two-dimensional array?

Q. Which of the following correctly accesses the seventh element stored in tan?

Q. Which of the following gives the memory address of the first element in array tan?

Q. What does the following declaration mean? int (*a)[10] a is

Q. What is the meaning of following declaration?
Int arr[20]

Q. int a[20]
What will be the size of above array elements?

Q. What is meaning of the following?
Int *ptr[20]

Q. In which way can SAM be stored in an array

Q. Int RollNUm[30[4] is a

Q. Comment on the following statement:

int (*a)[7];

Q. Comment on the 2 arrays regarding P and Q:

int *a1[8];
int *(a3[8]);

P. Array of pointers

Q. Pointer to an array