I don't think this can be done. Why do you want to do it without operators, anyway? It is fairly simple to use them. - Of course, you could write a method that adds two numbers, but your method will internally still have to use operators.
-----------------------------------------
Reply by lordstriker24@Yahoo.com
import java.math.BigInteger;
public class MultiplyTest {
public static void main(String[] args) {
BigInteger bigInt1 = new BigInteger("5");
BigInteger bigInt2 = new BigInteger("8");
System.out.println(bigInt1.add(bigInt2));
}
}
It is however tricky,you have to use bitwise shift operator
int multiply(int x, int y) {
int m=1, z =0;
while(x>=m && y) {
if (x &m) z=add(y,z);
y <<= 1; m<<= 1;
}
}
return z;
The idea is to use repeated addition. You can do this with a "for" loop.
You cannot compare 2 numbers without using relational operators. Certainly, you could subtract them, but you still need to test the result, and that is a relational operator in itself.
Not possible. Let's not forget than in C the followings are all operators:+, -+=, -=++, --=&, *, []function-call
By subtracting any two of the numbers A-B , if the output number is negative , B IS GREAT and if its positive A is great
How do you do. I am doing well thank you. Swap two number by using reference operators A tough assignment, it will make you think. I think you are confusing reference operators with pointers. Were I you I would study the section on pointers in your text book or course material.
you are a full time wanker.
using max function
You cannot compare 2 numbers without using relational operators. Certainly, you could subtract them, but you still need to test the result, and that is a relational operator in itself.
Not possible. Let's not forget than in C the followings are all operators:+, -+=, -=++, --=&, *, []function-call
By subtracting any two of the numbers A-B , if the output number is negative , B IS GREAT and if its positive A is great
By using repeated addition. Consider two numbers a and b. If you want to find a*b then you can add the numbers repeatedly in a loop to get the product. Eg:product = a;for( i=1; i
How do you do. I am doing well thank you. Swap two number by using reference operators A tough assignment, it will make you think. I think you are confusing reference operators with pointers. Were I you I would study the section on pointers in your text book or course material.
All numbers - integers as well as non-integers - are combined using different mathematical operations. Some operators are binary: that is, they combine two numbers to produce a third; some are ternary (combine 3 to produce a fourth) and so on.The set of integers is closed under some operations: common examples are addition, subtraction, multiplication, exponentiation. But not all operators are: division, for example.
There are infinitely many ways and these depend on what set of numbers and which operations you are allowed to use. Simple examples, using integers and addition: 1+ 379, 25 + 355 More complicated examples, using multiplication: 760 * 0.5 Using even more specialised operators, 144400^0.5
You cannot "do" numbers. You carry out specific operations on numbers and the answer to your question depends on which operator you want. Some operators require another number, such as addition, or subtraction, multiplication, division or exponentiation. Other operations do not: finding the additive inverse, the multiplicative inverse, the square, cube etc, square root, cube root etc, trigonometric or hyperbolic functions, logarithms and so on.
All of them, but it does depend on what operators are allowed.
void main() { float i,j; int a; printf("Enter two numbers : "); scanf("%f%f",&i&j); a=i/j; if(a) printf("%f is greater",i); else printf("%f is greater",j); }
by 4