0

Please tell me problem in this code 🙏😑

I am not able to see any error in this code . https://code.sololearn.com/cKm4q8uqUTpI/?ref=app

24th Feb 2022, 10:07 AM
Abhay mishra
Abhay mishra - avatar
5 Answers
+ 3
G'day Abhay mishra you have forgotten to put & before your variables in scanf() eg scanf("%d",&age); Your char name can only hold 1 letter, so lucky you aren't trying to save %s into it. If you want an array you could declare it as char name[20]; and refer to it with %s in scanf() and printf(). You also haven't put variables in your printf() statements. You can do something like printf("let him go, %c is not a criminal",name);
24th Feb 2022, 10:33 AM
HungryTradie
HungryTradie - avatar
24th Feb 2022, 10:24 AM
Sâùtôsh
Sâùtôsh - avatar
+ 1
Thank you sir . Code is exactly right . But i have not learned string . So i can't understand the %s and char name[ 20 ] .
24th Feb 2022, 10:29 AM
Abhay mishra
Abhay mishra - avatar
+ 1
Abhay mishra Ur welcome bro 👍
24th Feb 2022, 10:31 AM
Sâùtôsh
Sâùtôsh - avatar
0
Thank you sir
24th Feb 2022, 10:48 AM
Abhay mishra
Abhay mishra - avatar