- 1

Write C++ code that would read integers and stop when the value read is equal to 50

For (int x=0;x<50;x++){ cout<<"please enter your integers"; cin>>x; } cout<<"results"<<x<<end1;

9th Oct 2021, 10:44 AM
Tsebiso Motseki
Tsebiso Motseki - avatar
3 Answers
+ 8
Tsebiso Motseki , â–Șbefore we are going to help you, please present your attempt here. if you haven't done a try by yourself so far, please do so. create your code in playground and post the link to it here. â–Șplease also provide a proper task description with sample of input and output. â–Șif your question is related to a code coach exercise, please mention the tutorial name and the exercise number. BTW: the attached samples has no relation to the question you have raised. it would be better to remove them. thanks!
9th Oct 2021, 10:55 AM
Lothar
Lothar - avatar
+ 2
Tsebiso Motseki U have to read the integers until the user enters a number equal to 50.. U are not suppose to read the integers 50 time.. therefore no need to use for loop.. take a look here.. hope it helps.. :) https://code.sololearn.com/cW5xH8ToT7gl/?ref=app
9th Oct 2021, 11:21 AM
Indira
Indira - avatar