thats the main problem i have. Its not giving me the line of code that the errror is for. All the syntaxes are perfect. It must fails to execute and give me that error. this is a program that functioned flawlessly until today:
#include<stdio.h>
#include<math.h>
int a, b, d, e, f, op , sqt;
char c;
int main (void) /* basic mathermatical operacions*/
{
printf("enter a number");/*menu and asking for necessary data*/
scanf("%i",&a);
printf("enter another number");
scanf("%i",&b);
printf("this is the menu");
printf("\n 1. *");
printf("\n 2. +");
printf("\n 3. -");
printf("\n 4. /");
printf("\n 5. mod");
printf("\n 6. ^");
printf("\n 7. square root");
printf("\n choose an operation");
//fflush(stdin);
//c=getchar();
scanf("%d",&op); /* effectuado las operaciones*/
if(op==1){
d=a*b;
}
if(op==2){
d=a+b;
}
if(op==3){
d=a-b;
}
if(op==4){
d=a/b;
}
if(a>b||a==b)
{
if(op==5){ /* finding the mod* special function for mod*/
e=a/b;
printf("%d, is the the quotient and",e);
d=a-b*e;
}
}
if(a<b&&op==5)
{
printf("\n the first number is smaller than the second, the mod cannot be defined as a whole number");
}
if(op==6){ /*raises the first number to the power of the second*/
d=pow(a,b);
}
if(op==7){ /* square root operacion, special funcion inside, asks for data on which number to square root*/
do{
printf("\n for the square root of the first number enter 1 for the square root of the second number enter 2");
scanf("%d",&sqt);
if(sqt==1){
d=pow(a,0.5);
}
if(sqt==2){
d=pow(b,0.5);
}
}while(sqt!=2&&sqt!=1); /* validation ensuring user types 1 or 2 */
}
if(op<1||op>7){
printf("\n error no seas buey");
}
else{
printf(" \nthe result of your operation is: %d",d);
}
return 0;
}
I know its much, but its the only reference i have. It was working fine until today and i just dont get it. Thee error i mentioned just appears as an error, it doesnot point me to a line (i.e syntax error).