1 minggu 3 program

Dialing Fuction

Fuction are some blocks of code that was written before or after the function main ()
Fuction also is a way to organize the program in some parts of the block that has its own task.


Declaration:
Input: h, i, x, y (integer)
Output: A, Z (integer)

Description:
J, Z
h, i, x, y
J = h * i
Z = x * y

Program C + +

# include <iostream>
# include <conio.h>

Int count (int h, int i)
{
Int j;
J = h * i
Return (j);
}

Int main ()
{
Int x, y, z;
Z = x * y
Court <<"inputkan value of x:", cin>> x;
Court <<"inputkan y value:"; cin>> y;
Court <<"result:", cin>> z;

Program jeliot version

Import jeliot.io .*;

{public class function
public static void main () {
  / / your algorithm goes here

Function x = new function ();
Int x, y, z;
Float value of z;
System.out.print ("enter x =");
System.out.print ("enter y =");
X = input.readlnt ();
Y = input.readlnt ();
Z = (float) (x * y);
System.out.print (z)
}
}

Leave reply

Back to Top