View Code of Problem 1

#include<iostream>
using namesace std;
int main(){
int a,b;
  cin>>a>>b;
  cout>>(a+b);
  return 0;

}
/*
Main.cc:2:7: error: expected nested-name-specifier before 'namesace'
 using namesace std;
       ^
Main.cc: In function 'int main()':
Main.cc:5:3: error: 'cin' was not declared in this scope
   cin>>a>>b;
   ^
Main.cc:5:3: note: suggested alternative:
In file included from Main.cc:1:0:
/usr/include/c++/4.9/iostream:60:18: note:   'std::cin'
   extern istream cin;  /// Linked to standard input
                  ^
Main.cc:6:3: error: 'cout' was not declared in this scope
   cout>>(a+b);
   ^
Main.cc:6:3: note: suggested alternative:
In file included from Main.cc:1:0:
/usr/include/c++/4.9/iostream:61:18: note:   'std::cout'
   extern ostream cout;  /// Linked to standard output
                  ^
*/

Double click to view unformatted code.


Back to problem 1