wap in c to accept n number display the highest and lowest
value

Answer Posted / raghu

void main()
{
int n,a[],j,l,max,min;
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++)
{
if(a[i]<=min)
{
min=a[i];
}
else if(a[i]>=max)
{
max=a[i];
}
}
printf("highest value is:",max);
printf("lowest value is:",min);
}

Is This Answer Correct ?    7 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

State the difference between realloc and free.

619


What is the difference between array and structure in c?

563


Explain how do I determine whether a character is numeric, alphabetic, and so on?

644


What is actual argument?

581


What is conio h in c?

614






What are the benefits of c language?

637


Define VARIABLE?

684


Write a C++ program to generate 10 integer numbers between - 1000 and 1000, then store the summation of the odd positive numbers in variable call it sum_pos, then find the maximum digit in this variable regardless of its digits length.

1560


Can a pointer be null?

552


What is a good data structure to use for storing lines of text?

584


Why & is used in c?

701


write a programming in c to find the sum of all elements in an array through function.

1698


What is c language & why it is used?

572


What is the return type of sizeof?

583


program to convert a integer to string in c language'

1976