Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is cohesion in oop?

1112


What is the difference between inheritance and polymorphism?

1166


What is basic concept of oop?

1222


What is debug class?what is trace class? What differences are between them? With examples.

2261


Is abstract thinking intelligence?

1109


What is inheritance in simple words?

1118


What is encapsulation c#?

1127


can we make game by using c

4221


What is constructor in oop?

1172


What is the advantage of oop over procedural language?

1130


what is the drawback of classical methods in oops?

3430


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?

3606


What is polymorphism programming?

1179


write a program to find 2 power of a 5digit number with out using big int and exponent ?

2439


What is class in oop with example?

1160