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 out the maximum number out of the three inputs.

Answers were Sorted based on User's Feedback



how to find out the maximum number out of the three inputs...

Answer / hsandeep007

Hi Angads,

here is the code that need to implement.
I used java..

class largeNum{
public static void main(String args[])
{
int i,j,k;

i = Inter.parseInt(args[0]);
j = Inter.parseInt(args[1]);
k = Inter.parseInt(args[2]);



if (i>j && i>k)
{
system.out.print("i is max" + i);
}
else if(j>i && j>k)
{
system.out.print("j is max" + j);
}
else if(k>i && k>j)
{
system.out.print("k is max" + k);
}
}
}

Is This Answer Correct ?    32 Yes 13 No

how to find out the maximum number out of the three inputs...

Answer / dapumptu

If the inputs are a, b, and c,

max = a;
if (b > max) max = b;
if (c > max) max = c;

now max will contain the largest of the three.

Is This Answer Correct ?    17 Yes 6 No

how to find out the maximum number out of the three inputs...

Answer / ceeemor

#include<iostream>
using namespace std;
int main() {

int num[3];

cout << " Input 3 integers : ";
for (int i =0; i <3; i++) {
cin >> num[i];
}

sort(num, num+3);

cout << " The largest num in the given input s : " << num
[2] << endl;

return 0;
}

Is This Answer Correct ?    14 Yes 5 No

how to find out the maximum number out of the three inputs...

Answer / suganthi

27

Is This Answer Correct ?    18 Yes 12 No

how to find out the maximum number out of the three inputs...

Answer / pavan mustyala

//Single statement code using ternary operator

int max(int a, int b, int c)
{
return (((a > b) ? a : b) > c) ? ((a > b) ? a : b) : c;
}

Is This Answer Correct ?    14 Yes 8 No

how to find out the maximum number out of the three inputs...

Answer / leonard a wilson iii

//Done in c#
//using x,y,z to test the outcome as maximium

double x=45,y=25,z=2,maximium=0;
if (z != Math.Max(x,y))
maximium=Math.Max(x,z);
Console.WriteLine("x={0},y={1},z={2} the max
is{3}", x, y, z, maximium);


//Leonard A Wilson III

Is This Answer Correct ?    6 Yes 8 No

Post New Answer

More C++ Code Interview Questions

using repetition structure. Write a c program that will accept five numbers. The program should count and output the total count of even numbers and total count of add numbers.

2 Answers  


write a function – oriented program that calculates the sum of the squares from 1 to n. thus, if the input is 3, the output is 14

3 Answers  


A Binary no. is given, we hav to find it's decimal equivalent.

2 Answers   Microsoft,


write a program that accepts a number and outputs its equivalent in words. take note that the maximum input is 3000

1 Answers   Alvin,


Show by induction that 2n > n2, for all n > 4.

2 Answers   Karvy, Qatar University,


write a program to convert temperature from fa height into celcius and vise versa,use modular programming

0 Answers   Jomo Kenyatta University,


How do I store linked list datas into an array?

1 Answers  


A string of charaters were given. Find the highest occurance of a character and display that character. eg.: INPUT: AEGBCNAVNEETGUPTAEDAGPE OUTPUT: E

1 Answers  


develop a program to calculate and print body mass index for 200 employees

0 Answers   Jomo Kenyatta University,


write a program using 2 D that searches a number and display the number of items 12 inputs values input 15,20, 13, 30, 38, 40,16, 18, 20 ,18 ,20 enter no. to search : 20

0 Answers  


how to find out the maximum number out of the three inputs.

6 Answers   ABC, Apple, C3I, HP, TCS,


Wrie a function which returns the most frequent number in a list of integers. Handle the case of more than one number which meets this criterion. public static int[] GetFrequency(int[] list)

3 Answers   Nagarro,


Categories