//CIS 610-251: Data Structures and Algo //Assignment # 3 Question # 1 //Due: Oct 7,1999 #include main() { unsigned a,b,i,j,ans=0; //input values for a, b cout << "\nEnter the value for a :" ; cin >> a; cout << "\nEnter the value for b :"; cin >> b; // assign values to loop variable and the answer. i=(a>b)? b: a; ans=j=(a>b)? a: b; //if any input zero ans=0 if (!a || !b) ans=0; //calculate ans using addition for(;i>1;i--) ans+=j; cout << "\na * b = " << ans << '\n'; }