You are on page 1of 1

#include <stdio.

h>
#include <stdlib.h>

int main ()
{
int a = 1;
int b = 1;
while ((a <= 10) && (b <= 10))
{
printf(" %d\t%d\n\n", ++b, a++);
}
}

What are the differences between a++ & ++b?


Answer: When a programmer takes a++, that means he commanded to machine to take
value 1 and add with 1 until the condition will be completed. Like if one takes a = 1 and
command a machine a++, we will see 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 as output. On the other hand, if
a programmer takes ++b, the machine will take values from 1- 10 and add 1 with each of them.
The output will be 2, 3, 4, 5, 6, 7, ,8 ,9 ,10, 11. That’s it.

You might also like