+ 1

What is wrong with this code ?

#include<iostream> using namespace std; main() { long var=10; long x=0; while(x<=10) { var=var-x; //var-=x; ++x; cout<<var; } }

20th Jun 2022, 3:50 AM
Isbah
1 Answer
+ 2
Missing int type declaration on main(). Missing return statement at end of main(). (Optional) Missing newline or std::endl or other textual separator, like space or comma, at end of cout stream.
20th Jun 2022, 4:33 AM
Brian
Brian - avatar