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 operators can you overload in c++?
What do manipulators do?
State the difference between pre and post increment/decrement operations.
How to declare an array of pointers to integer?
What is the best way to declare and define global variables?
What is a pdb file?
Can we define a constructor as virtual in c++?
Explain stack unwinding.
What is c++ virtual inheritance?
What is the most useful programming language?
Comment on c++ standard exceptions?
Which is the best c++ software?
Explain the uses oof nested class?
Can member data be public?
What does 7/9*9 equal ? a) 1 b) 0.08642 c) 0