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


Please Help Members By Posting Answers For Below Questions

What is array in c with example?

619


What is the use of putchar function?

654


What is the scope of static variables in c language?

633


Explain the bubble sort algorithm.

649


What does a function declared as pascal do differently?

609






What is an array? What the different types of arrays in c?

662


How can a program be made to print the line number where an error occurs?

654


provide an example of the Group by clause, when would you use this clause

1711


Why are all header files not declared in every c program?

603


What is meant by int main ()?

721


Explain what is the benefit of using enum to declare a constant?

591


Explain how can you determine the size of an allocated portion of memory?

627


Explain how can you tell whether a program was compiled using c versus c++?

581


What is the purpose of void pointer?

601


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

636