write the program for maximum of the following numbers?
122,198,290,71,143,325,98
Answer Posted / mathew varghese
#include<stdio.h>
void main()
{
int a[10]={122,198,290,71,143,325,98};
int x,i;
x=a[0];
for(i=0;i<=6;i++)
{
if(a[i]>=x)
{
x=a[i];
}
}
printf("Maximum is %d \n",x);
}
Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What is array in c with example?
What is the use of putchar function?
What is the scope of static variables in c language?
Explain the bubble sort algorithm.
What does a function declared as pascal do differently?
What is an array? What the different types of arrays in c?
How can a program be made to print the line number where an error occurs?
provide an example of the Group by clause, when would you use this clause
Why are all header files not declared in every c program?
What is meant by int main ()?
Explain what is the benefit of using enum to declare a constant?
Explain how can you determine the size of an allocated portion of memory?
Explain how can you tell whether a program was compiled using c versus c++?
What is the purpose of void pointer?
a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list