Answer to Question #7405 in C++ for bilal ahsan

Question #7405
C++ programing to input for integers.find out the largest value and then print it on the screen by using nested if structur
1
Expert's answer
2012-04-12T07:15:22-0400
#include "stdafx.h"
#include <iostream>
#include
<conio.h>

using namespace std;

int _tmain(int argc, _TCHAR*
argv[])
{
int number;
int arrayofnumber[10000];
cout<<"Enter
number of element in array: ";
cin>>number;
for(int
i=0;i<number;i++){
cin>>arrayofnumber[i];
}
int
LargestNumber=arrayofnumber[0];
for(int
i=0;i<number;i++){
if(LargestNumber<arrayofnumber[i]){
LargestNumber=arrayofnumber[i];
}
}
cout<<"The
largest value is: "<<LargestNumber;
getch();

return 0;
}

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
APPROVED BY CLIENTS