Answer to Question #48656 in C++ for nazi khan

Question #48656
how to print ten no and how to find max among them
1
Expert's answer
2014-11-07T00:36:26-0500
/* Answer on Question#48656 - Subject - Programming, C++ */
#include <cstdlib>
#include <iostream>
using namespace std;
int main()
{
int i, j,S; //index
int a[9];
bool *mas; //bool array

cout << "Enter 10 numbers: \n";
for ( i=0; i<=9; i++)
cin >> a[i];

//print numbers
cout << "Entered numbers are: ";
for ( i=0; i<=9; i++ )
cout << a[i] <<" ";
// search for max number

int max = a[0];
for ( i = 1; i < 9; i++ )
if (a[i] > max)
max = a[i];
cout <<endl<<"Max number is: "<<max<<endl;

system("PAUSE");
return EXIT_SUCCESS;
}


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS