answersLogoWhite

0


Best Answer

import java.io.Writer;

import java.util.Scanner;

public class Teknoturf {

public static void main(String[] args) {

System.out

.println("This is Print Greater No without Using '<' '>' symbol and Math Library");

Scanner scan = new Scanner(System.in);

System.out.println("Enter No1------------->>");

int no1 = scan.nextInt();

System.out.println("Enter No2------------->>");

int no2 = scan.nextInt();

System.out.println("Enter No3------------->>");

int no3 = scan.nextInt();

Utility(no1, no2, no3);

}

static void Utility(int a, int b, int c) {

int temp = 0, temp1 = 0;

Integer AminusB = a - b;

String strAminusB = AminusB.toString();

if (strAminusB.substring(0, 1).equalsIgnoreCase("-")) {

temp = (a + b) / 2 - -(a - b) / 2;

} else {

temp = (a + b) / 2 - (a - b) / 2;

}

temp1 = a + b;

temp = temp1 - temp;

int help1 = temp - c;

Integer tempMinusC = temp - c;

String strtempMinusC = tempMinusC.toString();

if (strtempMinusC.substring(0, 1).equalsIgnoreCase("-")) {

temp1 = (temp + c) / 2 - -(temp - c) / 2;

} else {

temp1 = (temp + c) / 2 - (temp - c) / 2;

}

temp = temp + c;

temp1 = temp - temp1;

System.out.println("Greatest Number----------------------->>" + temp1);

}

}

this is only work for positive numbers ....

Thanks and Regards,

P.Marimuthu

www.teknoturfian.blogspot.com

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you find greatest number among three without conditional operator and Math Library Functions?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Function of Library catalog?

library catalogue functions


Which library is considered the 'Greatest in the world'?

The Library of Alexandria.


What command is used to make the functions in a library available in c?

You have to include the library into your assembled code by using an #include pre-processing directive. (It is the header file what you include, not the library.)Further, the author of the library functions would have had to set the accessibility of the functions to public.


What is the func?

what are the functions of a public library


Are functions organized in the Function Library group in Excel?

Yes, they are organised into categories in the functions Library group, which is on the ribbon's Formulas tab.


Functions of a audio visual room in the library?

Functions of a audio visual room.


What is the operator of power in c plus plus?

There is no "power" operator in C or C++. You need to the use the math library function pow().


How do you refresh stack using library functions in C programming?

What do you mean by stack-refreshing? Anyway, there are no stack handling functions in the standard C library.


What is string library functions syntax?

String library function is one which is used to perform an operation in C-programming,without which library functions likestrlen(),strcp(),strcmp(),strdup(),strrev(),etc..,.can be performed


How many functions are there in c?

The language itself has no functions at all. All functions are either provided by a library or are user-defined. The C89 standard library has fewer than 200 functions but C99 has a few more. Although the standard library is considered part of the language, the library and the language are physically separate. However, the language does have built-in operators like sizeof() that are function-like. But unlike actual functions which are evaluated at runtime, these operators are evaluated at compile time.


Can anyone let you know what does pipe function does in C?

The | operator in C is a bitwise inclusive OR. The operator in C is the logical inclusive OR. operator http://msdn.microsoft.com/en-us/library/f355wky8.aspx | operator http://msdn.microsoft.com/en-us/library/edc0fscw.aspx The main difference between the two is does short-circuit evaluation and | does not. Example: 1 1 is true. 1 1 is true.


How do you know whether the function is 'user define' or 'library functions'?

If you have written it yourself, then it is the former, otherwise it is the latter.