Solved

Input

Posted on 2000-03-06
4
188 Views
Last Modified: 2010-04-02
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?
0
Comment
Question by:SBuntin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 

Expert Comment

by:gashev
ID: 2588917
Example:

#include <iostream.h>

void main(void)
{
 int a,b,c;
 cin>>a>>b>>c;
 cout<<a<<endl<<b<<endl<<c<<endl;
}
0
 
LVL 22

Expert Comment

by:nietod
ID: 2588933
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.
0
 
LVL 22

Expert Comment

by:nietod
ID: 2588940
Opps, gashev beat me to it.  Gashev, you should have answered.  I'll withdraw mine.
0
 

Accepted Solution

by:
gashev earned 30 total points
ID: 2609870
Example:

#include <iostream.h>

void main(void)
{
 int a,b,c;
 cin>>a>>b>>c;
 cout<<a<<endl<<b<<endl<<c<<endl;
}
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question