Main.cc:3:10: error: ‘int y1’ redeclared as different kind of symbol int n,x1,y1,x2,y2; ^~ In file included from /usr/include/features.h:424:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/os_defines.h:39, from /usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:533, from /usr/include/c++/7/cassert:43, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:33, from Main.cc:1: /usr/include/x86_64-linux-gnu/bits/mathcalls.h:221:1: note: previous declaration ‘double y1(double)’ __MATHCALL (y1,, (_Mdouble_)); ^ Main.cc: In function ‘int main()’: Main.cc:8:12: error: expected primary-expression before ‘>’ token cin>>x1>>>y1>>x2>>y2; ^ Main.cc:8:15: error: invalid operands of types ‘double(double) throw ()’ and ‘int’ to binary ‘operator>>’ cin>>x1>>>y1>>x2>>y2; ~~^~~~ Main.cc:10:14: error: invalid conversion from ‘double (*)(double) throw ()’ to ‘int’ [-fpermissive] for(int k=y1;k<=y2;k++){ ^~ Main.cc:15:2: error: ‘ans’ was not declared in this scope ans=0; ^~~ Main.cc:15:2: note: suggested alternative: ‘abs’ ans=0; ^~~ abs