fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. cout<<"Hello World!";
  6. cout<<"Hello";
  7. cout<<"World";
  8. cout<<"Hello\n";
  9. cout<<"World";
  10. int a=3;
  11. float b=1.2;
  12. char anne='a';
  13. cout<<a<<endl;
  14. cout<<b<<endl;
  15. cout<<anne;
  16. int a=5,b=3,sum;
  17. cout<<a<<endl;
  18. cout<<b<<endl;
  19. sum=a+b;
  20. cout<<"The sum is"<<sum;
  21. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:16:5: error: redeclaration of ‘int a’
 int a=5,b=3,sum;
     ^
prog.cpp:10:5: note: ‘int a’ previously declared here
 int a=3;
     ^
prog.cpp:16:9: error: conflicting declaration ‘int b’
 int a=5,b=3,sum;
         ^
prog.cpp:11:7: note: previous declaration as ‘float b’
 float b=1.2;
       ^
stdout
Standard output is empty