Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Input

Posted on 2000-03-06
4
Medium Priority
?
190 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 60 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

Industry Leaders: 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

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

598 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