Friday, February 24, 2012

program fungsi

import jeliot.io.*;

public class MyFunction {
public static int tambah5(int xmasuk)
{
    return (xmasuk+5);
}

public static void main() {
     int x;
     int y;
     System.out.print("Masukkan harga x : ");
     x = Input.readInt();
     y = tambah5(x);
     System.out.print("Setelah masuk fungsi bernilai : ");
     System.out.print(y);
     }
}

No comments:

Post a Comment