Structure of the Problem Requirements
Function is very Important term in Programming . Functions Could be use in your Code with in Code Boundary Multiple time which save your time and Code a lot .In this Small and Simple Code we just tell you that how can you make a Function in Java and use it.
Source Code
import java.util.Scanner;
public class Function {
public static void main(String[] args) {
int x,y,z=0;
Scanner s = new Scanner (System.in);
System.out.println("Enter 1st Number ");
x = s.nextInt();
System.out.println("Enter 2nd Number");
y = s.nextInt();
z = multiplication (x,y);
System.out.println(z);
}
static int multiplication (int a, int b)
{
return (a*b);
}
}
Output of the Program
Java Functional Programming |
Asad Niazi is Software Engineer , Programmer, Web Developers and a young mentor of Tech Solutions Desk and Blogging Solutions . Asad Love to writes about Technology, Programming, Blogging and make money online.
a very good and unique way you adopt in coding ....specially the screen shoots of the program output
ReplyDeleteSnipping Tools :)
ReplyDelete