+ 1

How to create input for few times

Hello, How to create input for few times, i need it but it don't work? i use function cin for that few times in code but it don't works..

25th Nov 2017, 3:45 PM
connel21
4 Answers
0
cin>>a>>b>>c>>n;
25th Nov 2017, 3:47 PM
Momo Belia
Momo Belia - avatar
0
i tried but it asks just once to input my numbers, and when i enter, it won't show it after compile #include <iostream> using namespace std; int main() { char ch; int a, b, result; cout << "Test Calculator" << endl; cin >> a >> b; cin ch; switch(ch) { case '+': result = a + b; cout << result << endl; } return 0; } here's the example and after compile always ask me for input just once and don't show the result
25th Nov 2017, 4:01 PM
connel21
0
you can't get 2 input if you run your code at sololearn compiler try http://cpp.sh
25th Nov 2017, 4:03 PM
Momo Belia
Momo Belia - avatar
0
ok ty, i didn't know that..
25th Nov 2017, 4:06 PM
connel21