Language: C++

#include<iostream>
using namespace


int main(){

int x  , y;
char z;
cin >> x >>  z  >> y;


while( z != ? ){

if( z == + ){

cout << x << " + " << y << endl;

}

else if( z == - ){

cout << x << " - " << y << endl;

}

else if ( z == *){

cout << x << " * " << y << endl;

}

else if ( z == / ){

cout << x << " / " << y << endl;

}


}

return 0 ;
 
}

Compiler output:
a.cc:5:1: error: expected identifier before 'int'
    5 | int main(){
      | ^~~
a.cc:2:16: error: expected ';' before 'int'
    2 | using namespace
      |                ^
      |                ;
......
    5 | int main(){
      | ~~~             
a.cc: In function 'int main()':
a.cc:9:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 | cin >> x >>  z  >> y;
      | ^~~
      | std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:12:13: error: expected primary-expression before '?' token
   12 | while( z != ? ){
      |             ^
a.cc:12:15: error: expected primary-expression before ')' token
   12 | while( z != ? ){
      |               ^
a.cc:12:14: error: expected ':' before ')' token
   12 | while( z != ? ){
      |              ^~
      |              :
a.cc:12:15: error: expected primary-expression before ')' token
   12 | while( z != ? ){
      |               ^
a.cc:14:12: error: expected primary-expression before ')' token
   14 | if( z == + ){
      |            ^
a.cc:16:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 | cout << x << " + " << y << endl;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:16:28: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   16 | cout << x << " + " << y << endl;
      |                            ^~~~
      |                            std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:20:17: error: expected primary-expression before ')' token
   20 | else if( z == - ){
      |                 ^
a.cc:22:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   22 | cout << x << " - " << y << endl;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:22:28: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   22 | cout << x << " - " << y << endl;
      |                            ^~~~
      |                            std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:26:17: error: expected primary-expression before ')' token
   26 | else if ( z == *){
      |                 ^
a.cc:28:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   28 | cout << x << " * " << y << endl;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:28:28: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   28 | cout << x << " * " << y << endl;
      |                            ^~~~
      |                            std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:32:16: error: expected primary-expression before '/' token
   32 | else if ( z == / ){
      |                ^
a.cc:32:18: error: expected primary-expression before ')' token
   32 | else if ( z == / ){
      |                  ^
a.cc:34:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   34 | cout << x << " / " << y << endl;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:34:28: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   34 | cout << x << " / " << y << endl;
      |                            ^~~~
      |                            std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~