My program didn't work . I couldn't find any mistake . When i compiled it , it showed error in 17 line .What should i do ? Here is my code : Code: #include<stdio.h> #include<stdlib.h> #include<math.h> main() {long int a,b,c,d,e,f; d=1; scanf("%ld",&a); for(e=a;e>=1;e--) {f=a%e; if(f==0) { for(b=1;b<=sqrt(e);b++) {c=e%b; if(c==0) {d=d+1; } } if(d==2) { goto AA;} } } } AA: print("%ld",e); system("pause"); }
My mind reading skills are a bit off today. Would you be so kind as to tell us what the compiler error was? Please format your code for readability and post it using code tags. Type: [noparse] Code: int main() { return 0; } [/noparse] to give this: Code: int main() { return 0; } At a quick glance, it seems that there are more '}' than '{' characters.
Also please explain your alrogithm and what the variables are for. Using single letter variable names makes the code completely unreadable.