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 a driver program?

712


How can you quickly find the number of elements stored in a dynamic array?

692


What are proxy objects in c++?

741


Describe public access specifiers?

668


How to give an alternate name to a namespace?

676






What is enum class in c++?

792


What are 2 ways of exporting a function from a dll?

714


What are function prototypes?

825


Difference between Abstraction and encapsulation in C++?

676


What is object in c++ example?

709


declare an array of structure where the members of the structure are integer variable float variable integer array char variable access all elements of the structure using dot operator and this pointer operator

1840


Is c++ vector a linked list?

647


What are c++ redistributables?

654


How did c++ get its name?

661


How do we balance an AVL Tree in C++?

733