Q9 Write a program to find the range of a set of numbers entered through the keyboard. Range is the difference between the smallest and biggest number in the list.
Program: 102
Write a c program to find the range of a set of numbers entered through the keyboard. Range is the difference between the smallest and biggest number in the list.
Integer range:
Use #include<climits> or #include<limits.h>
create a variable and assign the following values
int max = INT_MAX
int min = INT_MIN
Output:
- max = 2147483647
- min = -2147483648
Output:
Enter an integer: 5 You want to add another integer(y/n)?: y Enter an integer: 10 You want to add another integer(y/n)?: y Enter an integer: -10 You want to add another integer(y/n)?: y Enter an integer: -50 You want to add another integer(y/n)?: n Range is 60