#include <iostream.h> // cin and cout are defined in this header
void main()
{
double Input=0; // This will hold keyboard input
double Total=0; // This will hold the total
// Type a welcome message
cout<<"Welcome to the C++ Game Tutorials Adding Machine"
<<endl;
{
cout<<Enter a number please. or else
}
//Loop till the user enters -666
while(Input!=-666)
{
cout<<"Enter a value (-666 to exit): "; // Prompt user
cin>>Input; // Take input
Total = Total + Input; // Add total
cout<<endl // Print total
<<"Total = "<<Total<<endl;
}
cout<<"Good Bye!"<<endl<<endl;
}
1. Well I need a way to say that if 'Input' is not a number, it displays "This is not a number."
2. Well when I compile for some programs, the screen usually just flashes and exits. is there a way to kind of pause the program for the viewer to clearly see the contents of the program.