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
I need previous papers of CSC.......plz help out by posting them.......
What is the scope of local variable in c?
Do you know null pointer?
The postoder traversal is 7,14,3,55,22,5,17 Then ur Inorder traversal is??? please help me on this
What is sizeof array in c?
Explain how can I convert a number to a string?
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.
What is the difference between c and python?
What is the basic structure of c?
how to find anagram without using string functions using only loops in c programming
Why we use break in c?
Can the curly brackets { } be used to enclose a single line of code?
Difference between MAC vs. IP Addressing
What is the role of && operator in a program code?
What is ambagious result in C? explain with an example.