0

how to reject a non-numeric entery at c language

16th Sep 2019, 6:50 PM
Hesham Aamer
Hesham Aamer - avatar
7 Antworten
+ 1
while(1) { printf("Input a natural number "); //ask user to input the number scanf("%lf",&number); //assigning the entered value to the variable if(number>=0) { //statements; } else { printf("Error! Enter a natural number\n"); } }
13th Dec 2020, 8:06 PM
Nimna Sahasri
Nimna Sahasri - avatar
0
i want to make user enter number in variable and if user entered non-numeric i will ask him to inter number again
16th Sep 2019, 7:39 PM
Hesham Aamer
Hesham Aamer - avatar
0
look bro i making program to making a pyramid of mario and i want to ask user to input height of this pyramid but if user entered non-numeric i will ask him to inter number again
16th Sep 2019, 8:42 PM
Hesham Aamer
Hesham Aamer - avatar
0
thanx bro 😍😍😍
16th Sep 2019, 9:28 PM
Hesham Aamer
Hesham Aamer - avatar