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
What are 3 types of structures?
What are Macros? What are its advantages and disadvantages?
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
Is struct oop?
Write a program to print factorial of given number without using recursion?
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.
Who is the founder of c language?
What are the different types of control structures in programming?
What is non linear data structure in c?
Explain which function in c can be used to append a string to another string?
What is c language & why it is used?
What are the restrictions of a modulus operator?
Why do we use & in c?
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)
How can I automatically locate a programs configuration files in the same directory as the executable?