Math, asked by gopal1976, 11 months ago

To find the range of set of numbers in c using loop

Answers

Answered by techtro
0

#include<stdio.h>

main()

{

int largest=-30000,smalest=30000,range,num;

char choice='y';

clrscr();

while(choice=='y')

{printf("input a number=");

scanf("%d",&num);

if(num>largest)

largest=num;

if(smalest>num)

smalest=num;

printf("do you want to add another number y/n=");

scanf("%c",choice);

choice=getche();}

range=largest-smalest;

printf("range is %d",range);

getch();

}

Similar questions