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
Question: Write a program that prints a paycheck. Ask the program user for the name of the employee, the hourly rate, and the number of hours worked. If the number of hours exceeds 40, the employee is paid “time and a half”, that is, 150 percent of the hourly rate on the hours exceeding 40. Be sure to use stepwi se refine ment and break your solution into several functions. Use the int_name function to print the dollar amount of the check.
Why is it so that we can have virtual constructors but we cannot have virtual destructors?
What are benefits of oop?
What is abstraction in oops with example?
What is difference between abstraction and encapsulation?
What is class and example?
What does and I oop and sksksk mean?
What are the 4 main oop principles?
officer say me - i am offered to a smoking , then what can you say
What is the difference between inheritance and polymorphism?
What is object and class in oops?
What are the features of oop?
What do you mean by abstraction?
What is object and example?
What is and I oop mean?