Originally Posted by
AndrewHunter
Well, if you understand the basic function of a while loop why don't you throw some code together. Go ahead and make an educated guess and post some code. We will go from there.
Code:
#include <stdio.h>
#include "genlib.h"
#include "simpio.h"
main()
{
int num1, num2, sum;
printf ("Enter two numbers to multiply: ");
num1 = GetInteger();
num2 = GetInteger();
sum = 0;
while (sum < num1 * num2)
{
sum = + num1 + num1;
}
printf ("product = %d.\n", sum);
getchar();
}
There you are, Andrew. I had this before I asked the question and it wasn't working. I've tried everything that I could think of. That is why I asked the question.