Answers for "CHECK THE RANGE OF NUMBER C"

C
0

CHECK THE RANGE OF NUMBER C

#include <stdio.h>

int main() {
	int x;
	printf("\nInput an integer: "); 
	scanf("%d", &x);
	if(x >=0 && x <= 20) 
	{
		printf("Range [0, 20]\n");
	} 
	else if(x >=21 && x <= 40) 
	{
		printf("Range (25,50]\n");
	} 
	else if(x >=41 && x <= 60) 
	{
		printf("Range (50,75]\n");
	} 
	else if(x >61 && x <= 80) {
		
		printf("Range (61,80]\n");
	} 
	else 
	{
	printf("Outside the range\n");
	}	
	return 0;
}
Posted by: Guest on August-06-2021

Code answers related to "CHECK THE RANGE OF NUMBER C"

Code answers related to "C"

Browse Popular Code Answers by Language