I want the remainder of all the numbers inside the loop except the number which i assigned for variable a
for example , if i entered number 5 for a,
the loop is 5 4 3 2 1.
i want my program to take remainder of all these values except 5.
How can i do this ??
Here is my program but it is calculating the remainder of all the numbers including the number i assigned for variable a.
i want it to calculate the remainder of all the numbers except the first value of the loop.
int main(void)
{
long a,b,c;
printf ("Enter number:");
scanf ("%ld",&a);
c=a;
for (a=a;a>1;a--)
{
b=c%a;
printf ("%ld\n",b);
}
getche ();
}