Sep 17, 2012 at 8:46pm Sep 17, 2012 at 8:46pm UTC
im new to c++
and i want to know how would i "promt the user to enter a double number"
Sep 17, 2012 at 9:50pm Sep 17, 2012 at 9:50pm UTC
#include <iostream>
int main(){
using namespace std;
double user_input;
cout << "Enter a number to double it: ";
cin >> user_input;
cout << user_input<< " times two is " << user_input * 2;
cin.get();
return 0;
}
Sorry I had to type this on a PS3.
Sep 17, 2012 at 9:53pm Sep 17, 2012 at 9:53pm UTC
I'm not sure if thats what you wanted. Your question wasnt that good.
Sep 17, 2012 at 9:58pm Sep 17, 2012 at 9:58pm UTC
@javi11
im new to c++
and i want to know how would i "promt the user to enter a double number"
It is enough to remove the initial part of the string literal that is instead of
"promt the user to enter a double number"
to use the following string literal :)
"enter a double number: "
Last edited on Sep 17, 2012 at 9:59pm Sep 17, 2012 at 9:59pm UTC