how to find the maximum of 10 numbers ?

Answer Posted / raj

int a[10],max=0;
cout<<"enter 10 numbers";

for(int i=0;i<10;i++)
{

cin>>a[i];

if(a[i]>max)
max=a[i];
}
cout<<"the maximum of entered 10 is"<<max;

Is This Answer Correct ?    9 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is Member Functions in Classes?

610


How come you find out if a linked-list is a cycle or not?

567


Write a corrected statement in c++ so that the statement will work properly. if (4 < x < 11) y=2*x;

1499


What is array in c++ example?

645


Do inline functions improve performance?

639






How does a C++ structure differ from a C++ class?

616


Differentiate between the manipulator and setf( ) function?

588


What are all predefined data types in c++?

554


what are the events occur in intr activated on interrupt vector table

1175


What is iterator c++?

541


What does it mean to declare a member variable as static?

608


Define pure virtual function?

557


Which is most difficult programming language?

578


In which situation the program terminates before reaching the breakpoint set by the user at the beginning of the mainq method?

584


What do you mean by global variables?

567