Thread: For Loop

  1. #1
    Registered User
    Join Date
    Apr 2002
    Posts
    3

    Exclamation For Loop

    I need to produce code that will print a table that shows the value of Pi by n (n from 1 to 10. I need to use a "for" loop. Can anyone assist?

    HELP!

  2. #2
    Code:
    for(int i=1; i<10; i++)
    {
    cout << "Pi by " << i << " = " << (i*3.14) << "\n";
    }
    That should be small and simple.
    -Mike
    {InFeStEd-ArCh0n}

Popular pages Recent additions subscribe to a feed
Website Security Test