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

I need previous papers of CSC.......plz help out by posting them.......

1813


What is the scope of local variable in c?

572


Do you know null pointer?

600


The postoder traversal is 7,14,3,55,22,5,17 Then ur Inorder traversal is??? please help me on this

2920


What is sizeof array in c?

588






Explain how can I convert a number to a string?

637


Sir,please help me out with the code of this question. Write an interactive C program that will encode or decode multiple lines of text. Store the encoded text within a data file, so that it can be retrieved and decoded at any time. The program should include the following features: (a) Enter text from the keyboard, encode the text and store the encoded text in a data file. (b) Retrieve the encoded text and display it in its encoded form. (c) Retrieve the encoded text, decode it and then display the decoded text. (d) End the computation. Test the program using several lines of text of your choice.

1759


What is the difference between c and python?

578


What is the basic structure of c?

551


how to find anagram without using string functions using only loops in c programming

2711


Why we use break in c?

544


Can the curly brackets { } be used to enclose a single line of code?

709


Difference between MAC vs. IP Addressing

635


What is the role of && operator in a program code?

564


What is ambagious result in C? explain with an example.

2049