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 / abhilash.d

void main()
{
int n,a[],j,l;
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++)
{
for(j=1;j<=i;j++)
{
if(a[i]<a[j])
{
l=a[i];
a[j]=a[i];
a[i]=l;
}
}
}
printf("highest value is:"a[0]);
printf("lowest value is:"a[0+n-1]);
}

Is This Answer Correct ?    10 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are 3 types of structures?

1026


What are Macros? What are its advantages and disadvantages?

1092


if (i = 0)printf ("True"); elseprintf("False"); Under what conditions will the above print out the string "True" a) Never b) Always c) When the value of i is 0 d) all of the above

1108


Is struct oop?

960


Write a program to print factorial of given number without using recursion?

951


Want to know how to write a C program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.

1985


Who is the founder of c language?

1108


What are the different types of control structures in programming?

1085


What is non linear data structure in c?

967


Explain which function in c can be used to append a string to another string?

1036


What is c language & why it is used?

1030


What are the restrictions of a modulus operator?

1062


Why do we use & in c?

949


Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)

6726


How can I automatically locate a programs configuration files in the same directory as the executable?

1103