Friday 18 July 2014

Write a Program in Java Which Make a Function of Multiplication of Two Numbers:

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 Function
Java Functional Programming






Share it Please
asad

About Author!

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.

2 comments: Post Yours! Read Comment Policy!▼
Important Note:
We have Zero Tolerance to Spam. Chessy Comments and Comments with Links will be deleted immediately upon our review.

  1. a very good and unique way you adopt in coding ....specially the screen shoots of the program output

    ReplyDelete