Write a Java program to multiply two given integers without using the multiply operator(*).
/* Write a Java program to multiply two given integers without using the
multiply operator(*). */
import java.util.*;
class Seven
{
public static void main( String arg[] )
{
Scanner obj = new Scanner(System.in);
int a, b, c=0;
System.out.print("\nEnter number for A :");
a = obj.nextInt();
System.out.print("Enter number for B :");
b = obj.nextInt();
for(int i=1 ; i<=b ; i++)
{
c = c + a;
}
System.out.println("\nMultiplication is : " + c );
}
}
More Information on our channel Programmer Community
please like , share and subscribe to get notifications of new videos....
To understand this program video will coming soon on our you tube channel
Comments
Post a Comment