Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package hellojava;
- import java.util.Scanner;
- public class HelloJava {
- public static void main(String[] args) {
- Scanner sn = new Scanner(System.in);
- Shape sp = new Shape();
- System.out.print("Enter the size: ");
- sp.numPyramid(sn.nextInt());
- }
- public static void split(int n){
- int rem, res = 1;
- while(n != 0){
- rem = n % 10;
- res *= rem;
- n = n / 10;
- }
- System.out.println(res + " ");
- }
- public static void decToBin(int n){
- int rem = 0, i = 0;
- int[] a = new int[5];
- while(n != 0){
- rem = n % 2;
- n = n / 2;
- a[i] = rem;
- i++;
- }
- for(int j = i-1; j >= 0; j--){
- System.out.print(a[j]);
- }
- System.out.println("");
- }
- }
Add Comment
Please, Sign In to add comment