-
#include <stdio.h>
-
-
-
int main;
-
int max;
-
char M,G,R,Q
-
int num1
-
int num2;
-
int base;
-
int power;
-
-
-
{
-
printf("Welcome to Math Helper v0.1, This program is designed to help you wi$
-
mulipication, exponents, and finding the greatest common divisor.");
-
-
printf("Please choose of the following options \n M=Print a muliplication ta$
-
G-Find the Greatest common divisor \n R-Raise a number to a power \n
-
Q-quit \n %f ", char);
-
-
scanf("%f "; &MS);
-
-
-
if (MS=M)
-
void PrintMultiplicationTable(int max);
-
-
if (MS=G)
-
int GreatestCommonDivisor(int num1, int num2);
-
-
if (MS=R)
-
int RaiseToPower(int base, int power);
-
-
if (MS=Q)
-
exit
-
-
-
-
return 0;
-
-
}
-
given is the code i've worked on and i keep getting the same errors on the same lines even though i've corrected them to my best. Please help and show me where and how i can fix if you can. Thank you.
There are several syntax errors in your program. Use of ';' at incorrect places itself is the cause of errors.
You have also missed ';' at declaration of the char variables and at declaration of 'num1'
You are missing main(), without which the program will not run.
Incorrect syntax is used to check for equality in if().
C/C++ doesn;t allow to use C/C++ keywords as variable names. Please check your first printf() statement to see the error.
Also, syntax of scanf() needs your attention.
Also, you have in the scanf() 'MS', which is not defined in the program.
Moreover, to call a function, function name is used without a ';' in the end.
In case of your example, this is a declaration of a function , not a call to it. Function declaration is not permitted in these places where you have them anyway.
This was just a brief. Please learn more C/C++ and re-write your code and let us know if you get errors again.
Regards
Qi