Instinct
Instinct

Reputation: 2251

How do I get 3 integer input on the same line and store it as 3 different variables?

I need to do something like this

int num1, num2, num3;

User Input: (num1) (blank space or tab) (num2) (blank space or tab) (num3) (blank space or tab)

(blank space or tab) can be " " or \t

cout << num1 << num2 << num3;

How would I go about doing this?

Upvotes: 0

Views: 3314

Answers (1)

Xymostech
Xymostech

Reputation: 9850

cin >> num1 >> num2 >> num3;

Upvotes: 2

Related Questions