how to find the maximum of 10 numbers ?

Answer Posted / amrutha

int a[]=new int[10];
int max=a[0];

for(int i=0; i<10; i++)
{
if(a[i]>max)
{
max=a[i];
}
}
System.out.println("Maximum of 10 :" + max);

Is This Answer Correct ?    21 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can comments be longer than one line?

706


Is set c++?

658


Why cstdlib is used in c++?

679


What is the use of volatile variable?

689


What is command line arguments in C++? What are its uses? Where we have to use this?

732






How long it will take to learn c++?

704


What is std :: flush?

679


Define vptr.

680


write a function signature with various number of parameters.

669


What is the latest c++ standard?

773


What happens if a pointer is deleted twice?

905


Explain what is polymorphism in c++?

722


Define whitespace in C++.

860


What is the difference between #import and #include?

671


What is #include c++?

666