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

Give the difference between the type casting and automatic type conversion. Also tell a suitable C++ code to illustrate both.

641


Which software is best for c++ programming?

585


What are namespaces in c++?

603


Why c++ is better than c language?

573


what is software cycle? What is a mission critical system ? What is the important aspect of a real-time system ? Explain the difference between microkernel and macro kernel. Give an example of microkernel.Why paging is used ? Which is the best page replacement algo and Why ? What is software life cycle ? How much time is spent usually in each phases and why Which one do U want to work if selected in Honeywell ? Which are the different types of testing ? What is a distributed system ? Some questions about CSP. Which languages do U know ? What are the differences between Pascal and C. questions from Compiler construction and Lisp. Which are the different computer architecture? What is the requirement in MIMD ? What is the difference between RISC and CISC processors ? Difference between loosely coupled and tightly coupled systems ? What is an open system?

1782






What are different types of loops in c++?

664


What is class definition in c++ ?

642


Differentiate between late binding and early binding.

656


Is c++ a good first language to learn?

584


What is the error in the code below and how should it be corrected?

313


what is Loop function? What are different types of Loops?

651


What is data abstraction? How is it different from data encapsulation?

545


Describe protected access specifiers?

690


Suppose that data is an array of 1000 integers. Write a single function call that will sort the 100 elements data [222] through data [321].

971


What is a template in c++?

648