| | |
Solve My Question Pls....
Thread Solved
![]() |
One way that came to mind is use 2 for-loops
Check out my New Bike at my Public Profile at the "About Me" tab
What about binary calculations 
010
AND
010
is
100

010
AND
010
is
100
Last edited by peter_budo; Nov 29th, 2008 at 7:54 pm.
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
•
•
Join Date: Nov 2008
Posts: 328
Reputation:
Solved Threads: 51
We can multiply/divide by 2 succesive using bitwise operators .
May be You are looking to The Vedas (Sanskrit वेद, véda, "knowledge") arithmetic .The product of the sum - Gunitasamuchyah.
(or Trachtenbergs system to speed multiply in memory).
quuba
byte a = 4;
byte b = (byte) (a >> 1);
byte c = (byte) (a >> 2);
byte d = (byte) (a << 1);
System.out.println(a);
System.out.println(b);
System.out.println(c);
System.out.println(d);(or Trachtenbergs system to speed multiply in memory).
quuba
I m still can't get the answer from u guys.....
Let me explain more in detail:
class add{
public static void main(String args[])
{
int a=2,b=2,c;
c=a+b;
System.out.println("C="+c);
}
}
This what we normally done using arith operator '+'.
I want the answer c=4 without using '+' or any arith operator.
Pls suggest ur ideas through the example.. i m a beginner in java so i can clearly understand... Hoping for u r answers......
Let me explain more in detail:
class add{
public static void main(String args[])
{
int a=2,b=2,c;
c=a+b;
System.out.println("C="+c);
}
}
This what we normally done using arith operator '+'.
I want the answer c=4 without using '+' or any arith operator.
Pls suggest ur ideas through the example.. i m a beginner in java so i can clearly understand... Hoping for u r answers......
•
•
Join Date: Nov 2008
Posts: 328
Reputation:
Solved Threads: 51
c=a+b; - here is arithmetic operator .System.out.println("C="+c); - here is overloaded operator + . Here this mean CONCATENATION of two String-s.
You can asked: c is not a String type. Yes it is true, but c is casting to String automatically before join.
In Your case You can write:
System.out.print("C=");
System.out.println(""+c);// "" (an empty String) can cast integer to StringSystem.out.print("C=");
System.out.println(c);// "" automatic cast int to StringRemark: Sign + in arithmetic has two menings:
1. before a single number indicate, positive number
2. between two numbers , sum operation
Try write:
System.out.println(c++); orSystem.out.println(++c); try explain differencequuba
Use XOR .
![]() |
Similar Threads
- Problem:Could anyone help me here pls. (Java)
- help me on this question, pls (C++)
- help me pls urgent! (C)
- I need help on these questios, pls ? can some one help (C)
- Pls help :Find first non-repeated char in a string (C++)
- structure (C)
- about shopping center (PHP)
- I can't open web link in OE6, please help (Web Browsers)
Other Threads in the Java Forum
- Previous Thread: How to make a Splash Screen
- Next Thread: Help with Dice Simulation
| Thread Tools | Search this Thread |
6 @param actuate affinetransform android api applet application arc array automation balls binary bluetooth bold business c++ class client code codesnippet collections color compare component coordinates database defaultmethod detection doctype dragging ebook eclipse educational error file fractal froglogic game givemetehcodez graphics gridlayout gui guitesting helpwithhomework html ide ideas image ingres intersect invokingapacheantprogrammatically j2me java java.xls javaexcel javaprojects jni jpanel jtextarea julia keytool keyword linux list map method methods mobile mysql netbeans nextline object parameter php pong problem producer program project projectideas recursive replaysolutions rim scanner sell server set size sms sql sun swing swt terminal threads tree web websites windows






