9th Apr 2022, 8:46 PM
Abhay mishra
Abhay mishra - avatar
1 Respuesta
0
getc(ch) takes a single character into ch. Not work for string input. Use fgets() for taking a string input Use Format specifier %f for floating values Like this : if(n == 1) { printf("Please enter your name = "); fgets(d1.name,20,stdin); //20 max size, from stdin stream into d1.name printf("Enter your driving licence number = ") ; scanf("%d" , &d1.licence); printf("Enter your Route you would like = ") ; fgets(d1.route,20,stdin); printf("Enter your driving experince = ") ; scanf("%f" , &d1.experince); }
9th Apr 2022, 9:17 PM
Jayakrishna 🇮🇳