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
can we make game by using c
What does and I oop mean in text?
What is encapsulation with example?
what type of questions
What does no cap mean?
Why multiple inheritance is not possible?
What is polymorphism what is it for and how is it used?
What is polymorphism and example?
What are the data types in oop?
What is class and example?
i=20;k=0;
for(j=1;k-i;k+=j<10?4:3)
{
cout< What is multilevel inheritance? Can a destructor be called directly? Why is it so that we can have virtual constructors but we
cannot have virtual destructors? Why do we use encapsulation in oops?