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 can I write data files which can be read on other machines with different word size, byte order, or floating point formats?
How to throw some light on the b tree?
What is meant by high-order and low-order bytes?
What is define c?
Explain setjmp()?
What is structure in c language?
What is the acronym for ansi?
What is the difference between call by value and call by reference in c?
What are the c keywords?
How do you define CONSTANT in C?
what is the significance of static storage class specifier?
Explain what math functions are available for integers? For floating point?
What does node * mean?
i = 25;switch (i) {case 25: printf("The value is 25 ");case 30: printf("The value is 30 "); When the above statements are executed the output will be : a) The value is 25 b) The value is 30 c) The value is 25 The value is 30 d) none
Where are c variables stored in memory?