#include<iostream.h>
#include<conio.h>
void main()
{
int multiplicand,multiplier,i,sum;
cout<<"Enter multiplier and multiplicand :";
cin>>multiplier>>multiplicand;
sum=0;
//determining the multiplication
int min=multiplier<=multiplicand?multiplier:multiplicand;
int max=multiplier>multiplicand?multiplier:multiplicand;
for(i=0;i<min;i++)
sum+=max;
cout<<"\nAnswer of (multiplier * multiplicand) :"<<sum;
//ends here
getch();
}
Output
No comments:
Post a Comment