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

Why is polymorphism important in oop?

800


What are the benefits of interface?

785


Write a c++ program to display pass and fail for three student using static member function

3073


What is destructor oops?

825


Why can't we have instance(stack) of a class as a member of the same class like eg.Class A{A obj;} as we can have self refential pointer

1884


2. Give the different notations for the class.\

1789


What is encapsulation in ict?

801


What are the 4 pillars of oop?

874


What is cohesion in oop?

832


Can abstract class have normal methods?

783


What is overloading and its types?

814


Can destructor be overloaded?

785


Hi friends I have experience of 6 months in website design and maintanence. Now i am looking for other IT jobs.. to switch platform. please post any interview you know in chennai.

1951


Get me a number puzzle game-program

1909


What is the real life example of polymorphism?

841