+ 2

Cheer creator

#include <iostream> using namespace std; int main() { //taking input int yards; cin >> yards; //cheer for over 10 yards if (yards >10){ cout << "High Five"; } //cheer for less than 1 yard if (yards <1){ cout << "shh"<<endl; } //cheer for more than 1 or exactly 10 int foil=0; while(foil <yards){ cout <<"Ra!"; foil++; } return 0; } Please why does test case 3 fail

15th Nov 2022, 3:55 PM
Theophilus
Theophilus - avatar
3 Antworten
+ 3
Add clear details for quick answers.. code for 3rd condition: cheer for more than 1 or exactly 10 , must be also in if block , for when first 2 conditions fails. Use if-else blocks there.. Check input 11: your code outputs "High Five" Next 11 "Ra!" Strings.. Hope it helps to understand it..
15th Nov 2022, 4:15 PM
Jayakrishna 🇮🇳
+ 2
Thanks Jayakrishna I used your fixes and had it correct
15th Nov 2022, 4:29 PM
Theophilus
Theophilus - avatar
+ 1
What is your question?
15th Nov 2022, 3:56 PM
KrOW
KrOW - avatar