here is the code:
Code:
#include <stdio.h>
int num1, num2, num3, num4;
int Counter;
int product(int x, int y);
int divide(int z, int a);
int main( void )
{
Counter == 1
while (Counter < 1000);
{
printf ("pick Multiply, divide(1,2):");
scanf ("%d", &num4);
printf ("enter a number:");
scanf ("%d", &num1);
printf ("Enter another number:");
scanf ("%d", &num2);
if (num4 == 1)
{
num3=product(num1,num2);
printf ("total multiplied is: %d",num3);
}
else
{
num3=divide(num1,num2);
printf ("total divided is: %d",num3);
}
Counter ++;
}
return 0;
}
int product(int x,int y)
{
return (x*y);
}
int divide(int z, int a)
{
return (z/a);
}
and the compile errors:
Code:
c:\docume~1\galgar~1\desktop\untitl~1.cpp: In function `int main()':
c:\docume~1\galgar~1\desktop\untitl~1.cpp:10: parse error before `while'
c:\docume~1\galgar~1\desktop\untitl~1.cpp:29: parse error before `}'