PDA

View Full Version : what function should i use?


psyche08
03-10-2005, 02:25 AM
i have this problem in making my program...what fucntion or code i use to make my program back again and again?
example when i ask name:
age:
grade:
and ask another and type yes. it will back...what function should i use?
thank you for replying

Unit
03-10-2005, 02:32 AM
Typically, this kind of flow is done by use of loops. It appears that you are following an class assignment, so I am not sure what looping structures you are familiar with.

Its good for you to do your homework assignment yourself, so I will illustrate what you need to do with a different example. Posting the code you have written already will help us point some things that can help you fix your program.

The following code will add 1 to i as long as the value of i is less than 10.

int i=0;
do
{
i = i + 1;
} while ( i < 10 );


The code above is using a programming construct called a do..while loop. There are other loops which can be employed to acheive the same effect. I am sure you will get familiar with them as you progress in your lessons.

psyche08
03-10-2005, 02:56 AM
thank you