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

can we make game by using c

4129


What does and I oop mean in text?

1211


What is encapsulation with example?

1093


what type of questions

2121


What does no cap mean?

1055


Why multiple inheritance is not possible?

1064


What is polymorphism what is it for and how is it used?

1011


What is polymorphism and example?

1044


What are the data types in oop?

1094


What is class and example?

1170


i=20;k=0; for(j=1;k-i;k+=j<10?4:3) { cout<

1847


What is multilevel inheritance?

1198


Can a destructor be called directly?

1066


Why is it so that we can have virtual constructors but we cannot have virtual destructors?

4921


Why do we use encapsulation in oops?

1025