array_multiplication
here is the source code please dont hesitate to give feedback to me on
https://www.facebook.com/invigorating.arslaan
#include<iostream>
using namespace std;
void main()
{
int num_1[5];
int multiply,divide,power,sum=0,mode,obtain=0,result=0,power_1=1,result_2;
float counter=0,counter_1=0;
int result_1=0;
cout<<" add first number ";
for(int i=0;i<5;i++)
{
cin>>num_1[i];
}
int num_2[5];
cout<<"add second number";
for(int j=0;j<5;j++)
{
cin>>num_2[j];
}
for(int i=4;i>=0;i--)
{
result=0;
counter=0;
//counter_1
for(int j=4;j>=0;j--)
{
multiply=num_1[i]*num_2[j];
mode=multiply%10;
divide=multiply/10;
int l=counter;
l=counter;
power=1;
while(l>0)
{
power=power*10;
l--;
}
counter++;
multiply=power*mode;
result=obtain+multiply+result;
obtain=divide;
}
//cout<<" PPPPP "<<result<<endl;
int k=counter_1;
power_1=1;
while(k>0)
{
power_1=power_1*10;
k--;
}
counter_1++;
result_2=power_1*result;
result_1=result_2+result_1;
}cout<<endl<<"result is "<<result_1;
}
Comments
Post a Comment