Enter everything in one line

0 John Kennedy · February 3, 2015
If I wanted to enter all the numbers in one line for example, 55 + 28 instead of having the program tell me twice to enter a number what would I have to write?

Post a Reply

Replies

Oldest  Newest  Rating
0 Pieter Huybrechts · February 3, 2015
int main(){
int x;
int y;

cout << "Give 2 numbers (separated by a space)";
cin >> x >> y;
cout << x << " & "<< y;

return 0;
}
  • 1

C++

107,275 followers
About

Used in many types of software including music players, video games, and many large scale applications.

Links
Moderators
Bucky Roberts Administrator