Help me understand

can someone help me understand line number 12-13
how it is working

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include<stdio.h>
#include<conio.h>
int main()
{
clrscr();
int a, b, c = 0;
printf("Enter any Number");
scanf("%d", &a);
b = a;
for(int i = a; i >= 1; i--)
  {
     if(!c) c = b; else c *= b;
     b--;
  }
   printf("%d", c);
   getch();
   }
Another way of writing those two lines is as follows.

1
2
3
4
5
6
7
8
9
if (c == 0) // if(!c)
{
	c = b;
}
else
{
	c = c * b; // c *= b;
}
b = b - 1; // b--; 

Topic archived. No new replies allowed.