Answer Posted / ahmed.aboelella
/**
As there is no need to save in array
Also we have to init max with first value to get max in case
user entered negative values
*/
#include "iostream"
using namespace std;
void main()
{
cout<<"Enter 10 numbers: ";
int i, temp, max;
//Enter first number to init max
cin>>max;
for(i = 0 ; i < 9; i ++)
{
cout<<"Enter Number: ";
cin>>temp;
max = temp > max ? temp : max;
}
cout<<"Max Number is "<<max<<endl;
}
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What are the types of container classes?
What is null c++?
Is turbo c++ free?
Explain the uses of static class data?
What is the use of lambda in c++?
What is conditions when using boolean operators?
Is it legal in c++ to overload operator++ so that it decrements a value in your class?
What is the difference between passing by reference and passing a reference?
How many types of comments are there in c++?
Name the operators that cannot be overloaded in C++?
Explain queue. How it can be implemented?
Why do we use templates?
Why c++ does not have finally?
What is a float in c++?
How come you find out if a linked-list is a cycle or not?