+ 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
3 Answers
+ 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..
+ 2
Thanks Jayakrishna
I used your fixes and had it correct
+ 1
What is your question?