Code:
/* B Jeater 2005, Program for inputting 2 numbers
and displaying the result of their multiplication */
#include <stdio.h> /*Standard Library Included*/
int main()
{
int Interger1; /*First Number to be Input*/
int Interger2; /*Second Number to be Input*/
int Result; /*Result of the Multiplication of the Input Numbers*/
printf ("This Program Will Multiply 2 Numbers Together,\n Please Enter your First Number: ");
scanf ("%d", &Interger1); /*Enters First Number*/
printf ("Please Enter your Second Number: ");
scanf ("%d", &Interger2); /*Enters Second Number*/
Result = Interger1 * Interger2; /*Multiplies the Numbers Together*/
printf ( "\n\n%d", Interger1);
printf ( " Multiplied by ");
printf ( "%d", Interger2);
printf ( " Equals ");
printf ( "%d", Result);
printf ( "\n");
cin.get();
return 0;
}
When i run that piece of code, it waits for the 2 inputs, then it works out the correct number, but doesn't give me time to see the answer before closing the command prompt . I thought that the cin.get would stop the program until I hit another key, but it didn't
Can someone help me out?