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
Write the syntax and purpose of a switch statement in C.
Write a program to reverse a string.
Explain 'bus error'?
What are the key features in c programming language?
How pointer is different from array?
What is the use of void pointer and null pointer in c language?
Explain how can I read and write comma-delimited text?
What extern c means?
explain what are pointers?
What does void main () mean?
Is it possible to initialize a variable at the time it was declared?
What are control structures? What are the different types?
a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none
How do I read the arrow keys? What about function keys?
How can I sort more data than will fit in memory?