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
Why is polymorphism important in oop?
What are the benefits of interface?
Write a c++ program to display pass and fail for three student using static member function
What is destructor oops?
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
2. Give the different notations for the class.\
What is encapsulation in ict?
What are the 4 pillars of oop?
What is cohesion in oop?
Can abstract class have normal methods?
What is overloading and its types?
Can destructor be overloaded?
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.
Get me a number puzzle game-program
What is the real life example of polymorphism?