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


Please Help Members By Posting Answers For Below Questions

What is the difference between union and anonymous union?

839


What is a program flowchart?

608


What is the maximum length of an identifier?

667


Can you write the function prototype, definition and mention the other requirements.

664


Write a code of a general series where the next element is the sum of last k terms.

598






What is the purpose of macro in C language?

665


Why void main is used in c?

562


typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?

1078


Is python a c language?

555


Write a program to swap two numbers without using the third variable?

601


In C programming, how do you insert quote characters (‘ and “) into the output screen?

898


What is an auto variable in c?

760


difference between Low, Middle, High Level languages in c ?

1636


write a program in c language to print your bio-data on the screen by using functions.

6253


How can you read a directory in a C program?

655