If i add scanf in this function i got strucked . | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

If i add scanf in this function i got strucked .

https://code.sololearn.com/cD91uVZ9yh79/?ref=app If i add scanf in this function i got strucked because if i enter 11 as input it gives welcome as result but the desired result oops please help me to solve this

1st Jul 2020, 11:58 AM
Akash Poovan
Akash Poovan - avatar
6 Answers
+ 1
Akash Poovan Do this int shoe_size; scanf("%d", &shoe_size);
1st Jul 2020, 12:05 PM
A͢J
A͢J - avatar
+ 13
Akash Poovan maybe you're doing something wrong it's working fine here with scanf(). #include<stdio.h> int main() { int shoe_size; scanf("%d",&shoe_size); if (shoe_size<=9) printf ("welcome"); else printf("oops"); }
1st Jul 2020, 12:05 PM
GAWEN STEASY
GAWEN STEASY - avatar
+ 6
Characters mentioned in scanf must be seen in the input. int h,m;scanf("%d:%d",&h,&m); Expects: 3:4
1st Jul 2020, 11:10 PM
John Wells
John Wells - avatar
+ 2
Thank you so much for your kind answers i found the mistake , that i wrote code like this [ scanf ("you shoe size%d",&shoe_size);] now i realised that nothing should be write inside a scanf.
1st Jul 2020, 12:10 PM
Akash Poovan
Akash Poovan - avatar
+ 1
AJ ANAT your very smart👏
1st Jul 2020, 12:30 PM
LitUpSeb
LitUpSeb - avatar
0
I think it's not an irony! ;)
1st Jul 2020, 4:22 PM
Akash Poovan
Akash Poovan - avatar