write the program for maximum of the following numbers?
122,198,290,71,143,325,98
Answer Posted / mehadi hasan
#include<stdio.h>
int main()
{
int a[50],i,max=0,num,min=200;
printf("enter num :");
scanf("%d",&num);
for(i=1;i<=num;i++)
{
printf("n%d:",i);
scanf("%d",&a[i]);
if(a[i]>max)
max=a[i];
if(min>a[i])
min=a[i];
}
printf("max is %d:\nAnd min is %d:\n",max,min);
return 0;
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is the advantage of using #define to declare a constant?
What was noalias and what ever happened to it?
if (i = 0)printf ("True"); elseprintf("False"); Under what conditions will the above print out the string "True" a) Never b) Always c) When the value of i is 0 d) all of the above
Are there namespaces in c?
Is c easier than java?
What is a program?
What is wrong with this code?
Can you please explain the difference between strcpy() and memcpy() function?
which of the following is not a character constant a) 'thank you' b) 'enter values of p, n ,r' c) '23.56E-o3' d) all of the above
Without Computer networks, Computers will be half the use. Comment.
What does %2f mean in c?
my project name is adulteration of chille powder.how can i explain it to the hr when he asks me about the project?
A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers
What is logical error?
What is use of pointer?