write the program for maximum of the following numbers?
122,198,290,71,143,325,98
Answer Posted / akhilesh singh
main()
{
int i,j,temp,a[7]={122,198,290,71,143,325,98};
for(i=0;i<=5;i++)
{
for(j=0;j<=6;j++)
{
if(a[j]<a[j+1])
{
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
}
}
printf("%d",a[0]);
}
| Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
What is the difference between scanf and fscanf?
What are the different file extensions involved when programming in C?
What is main function in c?
What is structure packing in c?
Explain what is the benefit of using #define to declare a constant?
How can I send mail from within a c program?
Explain what are bus errors, memory faults, and core dumps?
What is the difference between a function and a method in c?
What is volatile, register definition in C
Why c is called a middle level language?
What is %s and %d in c?
What happens if you free a pointer twice?
What is the use of a semicolon (;) at the end of every program statement?
Explain how can I write functions that take a variable number of arguments?
What is indirection? How many levels of pointers can you have?