Answer to Question #276295 in C for Mr Z

Question #276295

 write a program

1. Prompts the user to enter a number in the range of 1 to 255 from the keypad.

2. Waits for a user to enter a number in the range.


1
Expert's answer
2021-12-06T14:05:02-0500


#include<stdio.h>  


int main(){
	int number=-1;    
	
	while(number<1 || number>255){
		printf("Enter a number in the range of 1 to 255: ");    
		scanf("%d",&number);    
	}
	printf("The number is: %d\n\n",number); 
	


	getchar();
	getchar();
	return 0;  
}   

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS