write a function that takes an integer array as an input and
finds the largest number in the array. You can not sort
array or use any API or searching needs?
Answer Posted / pawan
#include<iostream>
using namespace std;
int main()
{
int name[5],big,i;
for(i=0; i<=4; i++) {
cout << "Enter a value" << i << ":";
cin >> name[i];
}
cout << "name contains:";
for(i=0; i<=4; i++) {
cout << name[i]<< "\n";
}
big = name[0];
for(i = 0; i <= 4; i++) {
if(name[i] > big)
big = name[i];
}
cout << "The Bigest Number::" << big << endl;
return 0;
}
Is This Answer Correct ? | 39 Yes | 0 No |
Post New Answer View All Answers
Is abstract thinking intelligence?
Why is abstraction needed?
What is ambiguity in inheritance?
what is graphics
what is the 3 types of system development life cycle
What is a superclass in oop?
What are the two different types of polymorphism?
What is overloading and its types?
Why oops is important?
What are benefits of oop?
What is destructor example?
What is the types of inheritance?
Can we create object of abstract class?
Why multiple inheritance is not possible?
write a code for this. serial_number contained in the header of the file will be read , if this serial number is less than a previous serial number within a successfully processed file, or is the same as another serial number within a successfully processed file, or if the field contains anything other than 7 digits, then the file must error with the reason ‘Invalid SERIAL_NUMBER’.