Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


how to find the maximum of 10 numbers ?

Answers were Sorted based on User's Feedback



how to find the maximum of 10 numbers ?..

Answer / amrutha

int a[]=new int[10];
int max=a[0];

for(int i=0; i<10; i++)
{
if(a[i]>max)
{
max=a[i];
}
}
System.out.println("Maximum of 10 :" + max);

Is This Answer Correct ?    21 Yes 8 No

how to find the maximum of 10 numbers ?..

Answer / raj

int a[10],max=0;
cout<<"enter 10 numbers";

for(int i=0;i<10;i++)
{

cin>>a[i];

if(a[i]>max)
max=a[i];
}
cout<<"the maximum of entered 10 is"<<max;

Is This Answer Correct ?    9 Yes 6 No

how to find the maximum of 10 numbers ?..

Answer / 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

how to find the maximum of 10 numbers ?..

Answer / ahmed.aboelella

/**
As there is no need to save in array
Also we have to init max with first value to get max in case
user entered negative values
*/

#include "iostream"

using namespace std;

void main()
{
cout<<"Enter 10 numbers: ";

int i, temp, max;

//Enter first number to init max
cin>>max;

for(i = 0 ; i < 9; i ++)
{
cout<<"Enter Number: ";
cin>>temp;
max = temp > max ? temp : max;
}

cout<<"Max Number is "<<max<<endl;

}

Is This Answer Correct ?    2 Yes 0 No

how to find the maximum of 10 numbers ?..

Answer / prits

#include <iostream>
using namespace std;

void main()
{
int max = 0;
int arr[10];
cout<<"Enter 10 numbers"<<endl;
for(int i = 0; i<=10; i++)
{
cin>>arr[i];
}
for(int i = 0; i<=10; i++)
{
if(arr[i]>max)
max =arr[i];

}

cout<<"Maximun of the 10 numbers is "<<max<<endl;

}

Is This Answer Correct ?    4 Yes 3 No

Post New Answer

More C++ General Interview Questions

What is constant in c++ with example?

0 Answers  


write a corrected statement in c++ so that the statement will work properly. x = y = z + 3a;

0 Answers  


When should I use unitbuf flag?

0 Answers  


Explain the purpose of the keyword volatile.

0 Answers  


What are smart pointer? Whats its use?

1 Answers   CTS,


What is a c++ object?

0 Answers  


Why is c++ still used?

0 Answers  


Which is better c++ or java?

0 Answers  


What are the basics concepts of OOPS?

1 Answers  


What is c++ try block?

0 Answers  


What is do..while loops structure?

0 Answers  


What are smart pointers?

3 Answers  


Categories