Program to find the
product of two numbers without Multiplication Operator.
Program
#include<stdio.h>
void main()
{
int x, y, I, sum;
printf("\nEnter
any two numbers : ");
scanf("%d%d",
&x, &y);
I = 1;
sum = 0;
while(I <= y)
{
sum += x;
I++;
}
printf("\nThe
Product of %d and %d is %d.", x, y, sum);
}
No comments:
Post a Comment