Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package pertemuan4;
- public class nomor3 {
- public static void main ( String [] args ){
- System.out.println("program rekursif menghitung Nomor Pokok Mahasiswa User hingga NPM 1 ");
- System.out.println("====================================================================");
- int NPM = 92;
- System.out.println("NPM Sian Nadao Sinaga = "+ NPM);
- System.out.println("\nhitungan Nomor Pokok Mahasiswa sebagai berikut ini ");
- System.out.println("====================================================================");
- hitung_Nomor_Pokok_Mahasiswa(NPM);
- }
- private static void hitung_Nomor_Pokok_Mahasiswa( int NPM ){
- System.out.println(" Nomor Pokok Mahasiswa Ke-" + NPM+ "= " + NPM);
- if( NPM==1){
- return;
- }
- NPM--;
- hitung_Nomor_Pokok_Mahasiswa(NPM);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement