Skip to content

Instantly share code, notes, and snippets.

@RafaelCenzano
Last active May 25, 2020 18:36
Show Gist options
  • Save RafaelCenzano/469a4e935698c93be547814405b459e0 to your computer and use it in GitHub Desktop.
Save RafaelCenzano/469a4e935698c93be547814405b459e0 to your computer and use it in GitHub Desktop.
Four 4s challenge trying to get integers from 1-10 {Completed} working on 11-20
public class Four4s{
public static void main(String[] args){
System.out.println("Four 4s challenge\n");
System.out.println(44-44);//0
System.out.println(44/44);//1
System.out.println((4/4)+(4/4));//2
System.out.println((4+4+4)/4);//3
System.out.println(((4-4)*4)+4);//4
System.out.println((44)/(4+4));//5
System.out.println(((4+4)/(4))+4);//6
System.out.println((44/4)-4);//7
System.out.println((4-4)+(4+4));//8
System.out.println((4/4)+4+4);//9
System.out.println((44-4)/4);//10
System.out.println((44+4)/(4));//12
System.out.println((4*4)-(4/4));//15
System.out.println((4*4)+(4-4));//16
System.out.println((4*4)+(4/4));//17
System.out.println((4+(4/4))*4);//20
System.out.println((4*4)+4+4);//24
System.out.println(44-(4*4));//28
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment