Answer Posted / namitha
#include<iostream.h>
main()
{
int a[10],n;
cout<<"enter ten numbers:\n";
for(int i=0;i<10;i++)
{
cin>>a[i];
}
int max=a[0];
for(i=0;i<10;i++)
{
if(a[i]>max)
max=a[i];
}
cout<<"the maximum number is:"<<max<<endl;
}
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
In what situations do you have to use initialization list rather than assignment in constructors?
What are the defining traits of an object-oriented language?
What is #include cstdlib in c++?
what are function pointers?
What are static variables?
Can the creation of operator** is allowed to perform the to-the-power-of operations?
What is the full form of dos?
Write a Program to find the largest of 4 no using macros.
What is the difference between a reference and a pointer?
Why do we use classes in programming?
What is friend class in c++ with example?
What is a lambda function c++?
How do you declare A pointer to function which receives an int pointer and returns a float pointer
Difference between a homogeneous and a heterogeneous container
A company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9 percent of their gross sales for that week. For example, a saleperson who sells $5000 worth of merchandise in a week receives $200 plus 9 percent of $5000, or a total of $650. You have been supplied with a list of items sold by each salesperson. The values of these items are as follows: Item Value A 239.99 B 129.75 C 99.95 D 350.89 Write a program that inputs one salesperson's items sold in a week (how many of item A? of item B? etc.) and calculates and displays that salesperson's earnings for that week.