0

How to take input from user on c++ more then 1 time.Is it possible

Pls help me

23rd May 2021, 9:21 AM
Nbs.Hoop
Nbs.Hoop - avatar
4 Réponses
+ 2
Use a loop for(int i = 0;i<5;i++){ int x; cin >> x; }
23rd May 2021, 9:46 AM
TOLUENE
TOLUENE - avatar
+ 1
multiple input are possible on c++, but sololearn playground requires that user give them all at once before sending script to server to be compiled/executed with the provided user inputs ^^ it means that it doesn't allow real interactivity: if you're expecting so, you must compile and execute on your side ;P
23rd May 2021, 3:38 PM
visph
visph - avatar
0
you can even use a recursion if you functions. eg-: void recursion(){ int input; cout << "Enter a value: "; cin >> input; recursion(); }
23rd May 2021, 2:52 PM
Rellot's screwdriver
Rellot's screwdriver - avatar