+ 2
Simple while QA
How can I modify this code to make it accept 4 entries <= 5? int num = 1; int number; while (num <= 5) { cin >> num; num++; }
6 Answers
+ 3
Inside the body of the loop, after getting the user's input, add this block
if (number == 5) break;
Happy ending all around! 8D
+ 6
Remove = in the while.. It should help.. 😅
while(num<5)
+ 3
Any chance you wrongly put
cin >> num;
instead of
cin >> number;
in the body of the loop?
+ 1
No, maybe you do not understood me.
if I run this code or even I remove = mark , the user stills can enter many numbers less than 5. But what I need is make this code allows to user to input just 5 entries ( if it was < 5 )
+ 1
yes, thank you soldier :)
0
Then, how to make this code end when the user input (5) at the first time?
Hot today
Python — File Handling
0 Votes
Loop question, I've tried everything that I knew I just don't know. Please help me solve it out
1 Votes
What is wrong? Error on test.
1 Votes
Help me solve this (using loop)
1 Votes
Help me wiht python
1 Votes
how can i flip any word with c++
0 Votes
Завершение процесса, код 3
0 Votes