Can't find why this code don't work!!! | Sololearn: Learn to code for FREE!

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; }

3/24/2020 10:02:11 AM

Noobie_coding

3 Answers

New Answer

+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

+1

Its hidden case in code coch

0

What the error you getting?