Main.cc: In function 'int main()': Main.cc:7:2: error: expected ';' before 'if' if(y%x!=0){ ^ Main.cc:10:7: error: invalid operands of types 'double' and 'double' to binary 'operator%' if(y%x==0){ ^