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
Give an example where we have to specifically use C programming language and C++ programming language cannot be used?
What is abstraction with example?
Can main method override?
What polymorphism means?
What is polymorphism and its types?
What are benefits of oop?
Can we create object of interface?
What is encapsulation with real life example?
Why do we use inheritance?
What is object in oop with example?
What is the main feature of oop?
Why do while loop is used?
What is encapsulation and abstraction? How are they implemented in C++?
what type of question are asked in thoughtworks pair programming round ?
What are the advantages of polymorphism?