Link to home
Start Free TrialLog in
Avatar of SBuntin
SBuntin

asked on

Input

How do you input numbers on the same line?

EX.

Tell how many quarters , pennies, and dimes you have? 1 2 3

How are you able to input them on the same line?
Avatar of gashev
gashev

Example:

#include <iostream.h>

void main(void)
{
 int a,b,c;
 cin>>a>>b>>c;
 cout<<a<<endl<<b<<endl<<c<<endl;
}
seperate them with spaces (or enters). like

int q, p, d;

cout << "Tell how many quarters , pennies, and dimes you have? 1 2 3 "
cin >> q >> p >> d;

then at the prompt type "1 2 3".  Let me know if you have any questions.
Opps, gashev beat me to it.  Gashev, you should have answered.  I'll withdraw mine.
ASKER CERTIFIED SOLUTION
Avatar of gashev
gashev

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial