### John Napier's Algorithm

i am trying to make john napier's algorithm table
can anyone help me in finding the error..
this code is not full
 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110`` ``````/* John Napier's Algorithm */ #include #include #include #include struct cards { int sqr[2][9]; }; cards v1[10]; struct depend { double power[2];int size[2]; }; int main() { void create_napier_table(); void display_napier_table(); depend dependence(int f1,int f2); int first,second,temp,first1,second1; cout << "Creating John Napier's Table...\n"; create_napier_table(); cout << "\n\nEnter 1st no.: "; cin >> first; cout << "Enter 2nd no.: "; cin >> second; first1=first;second1=second; if (first0) { n1=int (first / int (d1.power[0])); second=second1; while(second>0) { n2=second%10; v1[n1].sqr[0][n2-1]=0; v1[n1].sqr[1][n2-1]=0; display_napier_table(); row++;coloumn++; second=second/10; j+=2; } i++; d1.power[0]=d1.power[0]/10; first=first1-first; } for (int i=0;i0) { f1=f1/10; a++; } while(f2>0) { f2=f2/10; b++; } c=pow(10,(a-1)); d=pow(10,(b-1)); d2.size[0]=a; d2.size[1]=b; d2.power[0]=c; d2.power[1]=d; return (d2); } void display_napier_table() { cout << "\t\t\tJohn Napier's Multiplication table\n"; cout << "\n ==========================================================================="; cout << "\n0 0"; for (int i=1;i<=9;i++) cout << setw(8) << i; cout << "\n ==========================================================================="; for (int i=0;i<9;i++) { cout << "\n"; cout << i+1 << " "; for (int j=0;j<10;j++) cout << v1[j].sqr[0][i] << v1[j].sqr[1][i] << " |\t"; cout << " ---------------------------------------------------------------------------"; } }``````
Topic archived. No new replies allowed.