Friday, November 2, 2018

URI 1153 solution in C | Simple Factorial

/*Before seeing the code solution make sure that you have tried enough. Don’t copy- paste the whole code. Find out the logic. If you face any trouble, just inform me in comment.*/


#include<stdio.h>
main()
{
    int n,i,f=1;
    scanf("%d",&n);
    for(i=n;i>=1;i--)
    {
        f=f*i;
    }
    printf("%d\n",f);
    return 0;
}


 //Happy_Coding

No comments:

Post a Comment