mercredi 1 juillet 2015

i find it difficult to only allow numbers tried different methods and failed can anyone show me how its done

include

void main(void){

You are required to write a c program to find how many numbers are greater than the entered value between 1 and a user entered upper limit. for example, if you enter the value 15 as the upper limit and 7 as your number, then the program must give the output as 8.

The program output must be as shown below.

Enter an upper limit : 15 Enter a number between 1 and 15 : 7 ==> there are 8 numbers greater than 7 Do you want to check more values? (y/n)

if typed Y, clear the screen and prompt user to re-enter the upper limit and a number, and if typed n, end the program.

}

// can anyone help me in completing this? with the correct error messages and allowing only numbers to be input!

Aucun commentaire:

Enregistrer un commentaire