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
How do I convert a string to all upper or lower case?
Why is C language being considered a middle level language?
Can a program have two main functions?
How can I find the modification date and time of a file?
What is scope rule in c?
Is fortran still used in 2018?
Can a pointer be null?
What is use of #include in c?
What does c mean before a date?
List the different types of c tokens?
What is the meaning of ?
Tell me what is the purpose of 'register' keyword in c language?
One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.
Write a code to determine the total number of stops an elevator would take to serve N number of people.
What is the method to save data in stack data structure type?