0
The coutdown challenge
I do it like this #include <iostream> using namespace std; int main() { int n; cin >> n; //your code goes here do {cout << n << endl; if ( n%5==0) {cout << "Beep"<<endl;} n--;} while (n>=2); if (n==1) {cout << 1;} return 0; } It work but i think there is some problem, isnt it ? Or a shorter way to do it .-. Thanks
2 Answers
+ 1
Heres another way that works thats a lil shorter
while ( n >= 1)
{
cout << n << endl;
if (n % 5 == 0)
{
cout << "Beep" << endl;
}
n--;
}
0
Oh ... i thought the new line at the end will make it wrong lol. Thx u so much :Ä