write the program for maximum of the following numbers?
122,198,290,71,143,325,98

Answer Posted / divya

#inclufe<stdio.h>
Void main()
{
int a[7];
for(i=0;i<=7;i++)
{
printf("Enter the nos");
scanf("%d",&a[i]);
}
for(i=0;i<=7;i++)
{
if(a[i]>a[i+1])
printf("%d",a[i]);
else
if(a[i]<a[i+1])
printf("%d",a[i+]);
else
if(a[i]==a[i+1])
printf("%d",a[i]);
}
getch();
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

void main(int n) { if(n==0) return; main(--n); printf("%d ",n); getch(); } how it work and what will be its output...............it any one know ans plz reply

2229


Is there sort function in c?

581


When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?

591


What are the standard predefined macros?

637


Write a program to know whether the input number is an armstrong number.

675






Why is sprintf unsafe?

621


What is #define used for in c?

618


How can a program be made to print the name of a source file where an error occurs?

734


Can one function call another?

630


Write a program to print “hello world” without using semicolon?

677


Is a house a mass structure?

644


What are actual arguments?

649


What is the advantage of a random access file?

642


Can you please compare array with pointer?

619


What is scope and lifetime of a variable in c?

581