Saturday, May 22, 2010

How can i read a single digit from keyboard in C programming language?

Write a C program that reads a single digit from the keyboard and writes it out n times where n is the number read in. For example, the user enters the number 6, then the number 6 should be printed out to the screen 6 times.





Try to enter invalid input, e.g. a character instead of a number. What happens?





Amend the program to validate the input from the user and display appropriate error messages.

How can i read a single digit from keyboard in C programming language?
a = scanf();


for( i=0;i%26lt;5;i++){


print(a);


}
Reply:I'm not gonna do your homework for you.


No comments:

Post a Comment