Skip to content

Instantly share code, notes, and snippets.

@kddlb
Created April 24, 2014 20:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kddlb/11268242 to your computer and use it in GitHub Desktop.
Save kddlb/11268242 to your computer and use it in GitHub Desktop.
??
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package resarg;
/**
*
* @author Kevin
*/
public class Resarg {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
int a = 9;
int b = 6;
int c = 0;
while (a != 0) {
if (a % 2 != 0) {
c = c + b;
}
a = a / 2;
b = b * 2;
}
System.out.println(c);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment