63 209
Assignments Done
99,3%
Successfully Done
In July 2018

Answer to Question #18515 in C++ for Robert Noel

Question #18515
write the program of check of knowledge of date of beginning of Saint Petersburg. In case of the wrong answer of the user, the program should deduce a right answer. Below the recommended type of the screen during performance of program. It should look as follows:-
In which year was St.Petersburg started? Put a number: 1705, then press <Enter>, then the program should answer You were mistaken, Saint Petersburg was started in: 1703.
Expert's answer
#include "iostream"
using namespace std;

int main()
{ int i;
& cout <<"In which year was St.Petersburg started? Put a number: ";
& cin>>i;
& if (i==1703)
cout<<"You are right\n" ;
else
cout<<"You were mistaken, Saint Petersburg was started in: 1703.\n";

system ("PAUSE");
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions