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
What is cohesion in oop?
What is the difference between inheritance and polymorphism?
What is basic concept of oop?
What is debug class?what is trace class? What differences are between them? With examples.
Is abstract thinking intelligence?
What is inheritance in simple words?
What is encapsulation c#?
can we make game by using c
What is constructor in oop?
What is the advantage of oop over procedural language?
what is the drawback of classical methods in oops?
if i have same function with same number of argument but defined in different files. Now i am adding these two files in a third file and calling this function . which will get called and wht decide the precedence?
What is polymorphism programming?
write a program to find 2 power of a 5digit number with out using big int and exponent ?
What is class in oop with example?