Can't find why this code don't work!!! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can't find why this code don't work!!!

#include <stdio.h> int main() { int yard,n=1; scanf("%d",&yard); if(yard <1){printf("shh");} if(yard>10){printf("High Five");} if(yard>=1|| yard<=10){ for(n=1;n<=yard;n++){printf("Ra!");} } return 0; }

24th Mar 2020, 10:02 AM
Vedant Mishra
Vedant Mishra - avatar
3 Answers
+ 1
You are using or condition if last if.. That matches all Integer values.. Must use && instead of ||. if(yard>=1 && yard<=10) or Use if else blocks
24th Mar 2020, 10:17 AM
Jayakrishna 🇮🇳
+ 1
Its hidden case in code coch
24th Mar 2020, 10:13 AM
Vedant Mishra
Vedant Mishra - avatar
0
What the error you getting?
24th Mar 2020, 10:11 AM
Jayakrishna 🇮🇳