0
Can someone help me with this ?? Cause I can't produce 'Beep' in new line 😅
#include <iostream> using namespace std; int main() { int N; cin >> N; while(N>0){ cout << N; N--; cout <<endl; if(N%5==0){ cout << "Beep"; } } //your code goes here return 0; }
3 Antworten
+ 1
Thank You guys 😊😊
0
Be careful that you're decrementing N before checking if it is divisible by 5 so to beep the input must be at least 6
0
Lucas Evergreen
Decrement N after checking condition because after printing 5, N will be 4 and 4 % 5 == 0 will be false. So "Beep" will not be print