product of two numbers using functions
Lets get started
- /* here we are going to create a function that will return product of two numbers */
- import java.util.* ;
- public class MINtech{
- public static void main(String args[]){
- Scanner sc = new Scanner(System.in);
- int a = sc.nextInt() ;
- int b = sc.nextInt() ;
- // calling the function
- int result = doSomething(a,b) ;
- // printing the result
- System.out.println(result);
- }
- // creating the function
- public static int doSomething(int a , int b ){
- return a*b ;
- }
- }
Output
4 8 32 100 200 30000 2024 2023 4094552
No comments:
Post a Comment