Factorial:



main()
{
    int r,c,s=0;
    clrscr();

    for(r=1;r<=5;r++)
    {
        s=1;
        for(c=1;c<=r;c++)
        {
            s=s*c;
        }
        printf(“fact of %d=%d”,r,s);
        printf(“\n”);
    }
getch();
}
           

Output: