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
How oops is better than procedural?
Can abstract class have normal methods?
Why it is called runtime polymorphism?
officer say me - i am offered to a smoking , then what can you say
what are the realtime excercises in C++?
They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?
Can we have inheritance without polymorphism?
What is basic concept of oop?
What is for loop and its syntax?
#include
What is the fundamental idea of oop?
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
What is protected in oop?
write string class as your own class in java without using any built-in function
When not to use object oriented programming?