+ 3
I'm falling from a 35 storey building, help me break my fall at the 2nd floor with your awesome code?
An easy fun task....any programming language allowed c++, c, python etc
5 odpowiedzi
+ 4
#include <iostream>
using namespace std;
void myfall(){
cout<<"you are falling"<<endl;
for(int y = 35;y>0;y--){
cout <<"floor "<<y<<endl;
if (y==2){
break ;
}
}
cout<<"your fall has been broken(break'd) mr. Umenwaniri ";
}
int main() {
myfall();
return 0;
}
+ 3
#include <iostream>
using namespace std;
int main() {
int cfloor = 35;
cout <<"You are falling from a 35 storey building\n";
while(cfloor > 2)
{
cout<<"You are at "<<cfloor<<"th floor now. ";
cout<<"Still falling\n";
cfloor --;
}
cout<<"Ah, you finally managed to grab a window ledge at 2nd floor.\n";
cout<<"Somehow you managed to hold on till help arrived";
return 0;
}
+ 1
int level=35;
while (level > 2) {
level--;
}
+ 1
@marco linde 👍👍👍👌
0
attempt my next task guys😊😊 lets see how fast you can solve it