Saturday
December 27, 2014

Homework Help: uhd

Posted by sardar on Thursday, February 16, 2012 at 6:34am.

int carry=0;
int prod,i,j,rem;
int base=10;

else if ( op == '*' ) //checks for operator, performs array multiplication
{
for(i=size-1; i>-1;i--)
{
for(int j=size-1; j>-1;j--)
{
prod =firNum[i]*secNum[j];
prod += carry;

if(prod>=base)
{
carry = (prod/base);
prod -= (carry*base);
}

else
{
carry = 0;
final[i+j] += prod;

if(final[i+j] >= base)
{
rem = (final[i+j]/base);
final[i+j] -= rem*base;
carry += rem;
}
if(final[i+j] >= base)
{
final[i+j-1] += (final[i+j]/base);
final[i+j] = final[i+j] % base;
}
}
}
}

Answer this Question

First Name:
School Subject:
Answer:

Related Questions

computer science - int *reverse(const int *, int); int *temp; temp = reverse(...
C# - 5) Suppose you have declared an integer array named scores and you make the...
computer science - 9.10: Reverse Array Write a function that accepts an int ...
Computers - //program that puts two lists in order in one single list with all ...
computer - If int main() { int a=1; int *p; how do the following statements ...
Computer Science - //program that puts two lists in order in one single list ...
shabou - Can someone please make a Binarytree of these methodes in Java?: public...
check my precalc - #1. (3x^3-4x^2-3x+4)/(x^3-5x) my answers: y-int: NONE x-int: ...
Precalc - #1. (3x^3-4x^2-3x+4)/(x^3-5x) my answers: y-int: NONE x-int: 1, -1, ...
Calculus - Can someone tell me how to do these? Estimate INT from 0 to 1 2/(1+x^...

Search
Members