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
How to get string length of given string in c?
What is modeling?
What are the features of c language?
Explain the concept and use of type void.
Place the #include statement must be written in the program?
Why does this code crash?
Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
What is a lookup table in c?
List the difference between a 'copy constructor' and a 'assignment operator' in C?
What is a null pointer in c?
Can we use any name in place of argv and argc as command line arguments?
How do you view the path?
What does %c do in c?
What is the collection of communication lines and routers called?
How can you tell whether two strings are the same?