#include <stdio.h>
#include <stdlib.h>
int main()
{
int a , b ,c ;
printf("Enter values for a and b: ");
scanf("%d%d",&a,&b);
a = a + b-- ;
if (a<b){
c = -1;
printf("\n\t%d %d %d\n\n",a,b,c);
}
else {
c = 0;
printf("\n\t%d %d %d\n\n",a,b,c);
}
}
Lets assume the value of the input for a and b are 2 (for both of them).
I studied the above program, but when it comes to the output it will be 4 1 0, a=4,b=1,c=0.
But, the calculation part above said that a=a+b-1 which will be the value of a is 3, now the new value of a is 3. But for b the value is still 2 because we didn't assign a new value to it.
I am very confused about the output.