Loops using while statement?????

This is a discussion on Loops using while statement????? within the C Programming forums, part of the General Programming Boards category; Help, I am trying to write a C program that uses the while and for statements. Also my output should ...

  1. #1
    Registered User
    Join Date
    Jan 2002
    Posts
    20

    Angry Loops using while statement?????

    Help, I am trying to write a C program that uses the while and for statements. Also my output should generate a table with two columns. The program is supposed to classify each integer as eiter perfect, abundant, or deficient. I am supposed to use the % operator. I am having trouble, and running out of patience. Please help if you can. I would greatly appreciate it.
    Thanks,
    Kristina
    Last edited by bearcat19; 01-28-2002 at 10:04 AM.

  2. #2
    Mayor of Awesometown Govtcheez's Avatar
    Join Date
    Aug 2001
    Location
    MI
    Posts
    8,825
    while loop:

    while(condition == true)
    {
    do stuff
    }

    executes until the condition isn't true anymore

    for loop:

    for(counter = 0; counter<stop; counter++)
    {
    do stuff
    }

    executes stop # of times - counter's incremented on every pass.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Usefulness of the "else if" statement
    By gn17 in forum C Programming
    Replies: 7
    Last Post: 08-12-2007, 05:19 AM
  2. syntax question
    By cyph1e in forum C Programming
    Replies: 19
    Last Post: 03-30-2006, 11:59 PM
  3. If Else statement problem
    By doofusboy in forum C Programming
    Replies: 2
    Last Post: 11-09-2005, 06:18 AM
  4. loops in a main statement....
    By xero18 in forum C Programming
    Replies: 8
    Last Post: 10-30-2005, 08:36 PM
  5. Uh-oh! I am having a major switch problem!
    By goodn in forum C Programming
    Replies: 4
    Last Post: 11-01-2001, 03:49 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21