If i add scanf in this function i got strucked . | SoloLearn: Learn to code for FREE!

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

7/1/2020 11:58:14 AM

Akash Poovan

6 Answers

New Answer

+1

Akash Poovan Do this int shoe_size; scanf("%d", &shoe_size);

+11

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

+6

Characters mentioned in scanf must be seen in the input. int h,m;scanf("%d:%d",&h,&m); Expects: 3:4

+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.

+1

AJ ANAT your very smart👏

0

I think it's not an irony! ;)