TOPIC

Printing all value

Zulkar-nain Hunts asked 3 years ago

Can anybody tell me how can I print my last N! Here is my code

Question solved. Code removed.

When I print then showing   1  2   6   24
how can I print my last factorial

This topic was solved and cannot recieve new replies.

  • Gustavo Marini replied 3 years ago

    Hi!

    Just place your printf() outside the for() loop. You also forgot to include a end of line to your output. With all corrections, the solution must be:

    for (i = 1; i<=num; i++) {
        fact*=i;
    }
    printf("%d\n",fact);
    MOD