fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int a,b,c,d,results;
  6. string enter;
  7.  
  8. int main()
  9. {
  10. cout << "How are you doing today?\n";
  11. getline (cin,enter);
  12. cout << "I am glad you are doing " << enter << " today.\n";
  13. cout << "Would you like to take a test today?\n";
  14. getline (cin,enter);
  15. cout << "Good I promise it will be fun.\n" << "Lets get started..\n";
  16. cout << "For the first question, what is 4x3 equal to? \n";
  17.  
  18. getline (cin,enter);
  19.  
  20. if(enter=12)
  21. {
  22. cout << "CORRECT!";
  23. }
  24. else
  25. {
  26. cout << "Sorry, that was not correct.";
  27. }
  28.  
  29.  
  30. system("pause");
  31. return 0;
  32.  
  33. }
  34.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:20:15: error: could not convert 'enter.std::basic_string<_CharT, _Traits, _Alloc>::operator=<char, std::char_traits<char>, std::allocator<char> >(12)' from 'std::basic_string<char>' to 'bool'
    if(enter=12)
               ^
prog.cpp:30:19: error: 'system' was not declared in this scope
     system("pause");
                   ^
stdout
Standard output is empty