Programing Using For loop

Discussion in 'C' started by Peepin, Dec 8, 2011.

  1. Peepin

    Peepin New Member

    Joined:
    Dec 7, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Code:
    /* program to print factorial of a number Dev. by Peepin :) */
    #include<stdio.h>
    main()
    {
                int i,n,fact=1;
                printf("Enter A Number\n");
                scanf("%d",&n);
                for(i=1;i<=n;fact*=i,i++);
                printf("%d Factorial Is %d\n",n,fact);
    }
    /* ENJOY */
     
    Last edited by a moderator: Dec 9, 2011
  2. Peepin

    Peepin New Member

    Joined:
    Dec 7, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    What Code blocks
     
  3. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,367
    Likes Received:
    385
    Trophy Points:
    83
    Clicking the link can help
     
  4. sura

    sura Banned

    Joined:
    Aug 4, 2011
    Messages:
    47
    Likes Received:
    1
    Trophy Points:
    0
    Location:
    India,Tamil Nadu.
    cool but try more advance next time.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice