+ 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..
4 Respuestas
0
cin>>a>>b>>c>>n;
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
0
you can't get 2 input if you run your code at sololearn compiler
try http://cpp.sh
0
ok ty, i didn't know that..