Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

wap in c to accept n number display the highest and lowest
value

Answer Posted / raghu

void main()
{
int n,a[],j,l,max,min;
printf("enter the no.of numbers to accept");
scanf("%d",&n);
printf("enter the numbers");
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<n;i++)
{
if(a[i]<=min)
{
min=a[i];
}
else if(a[i]>=max)
{
max=a[i];
}
}
printf("highest value is:",max);
printf("lowest value is:",min);
}

Is This Answer Correct ?    7 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to get string length of given string in c?

1014


What is modeling?

1003


What are the features of c language?

1025


Explain the concept and use of type void.

1064


Place the #include statement must be written in the program?

993


Why does this code crash?

1030


Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

1036


What is a lookup table in c?

1049


List the difference between a 'copy constructor' and a 'assignment operator' in C?

1036


What is a null pointer in c?

1126


Can we use any name in place of argv and argc as command line arguments?

1016


How do you view the path?

1078


What does %c do in c?

942


What is the collection of communication lines and routers called?

1062


How can you tell whether two strings are the same?

1206