The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 3 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
1.Division Given two numbers a and b, print the quotient and remainder of a/b. Use the Repeated subtraction procedure taught in class.
The first line will contain a number t. The next t lines contain two numbers a and b.
For each test case, print the value of a after each iteration. Print one more line at the end with the quotient and remainder seperated by spaces.
2
53 5
36 8
48
43
38
33
28
23
18
13
8
3
10 3
28
20
12
4
4 4
0=a,b=100000000(10^8)
2.
Fast Multiplication Given two numbers a and b, find their product using the more efficient multiplication algorithm taught in the class. Also, print the value of a everytime it's added to the answer.
There are several test cases.
The number of lines output for a test case depends on the value of b.
Leave a blank line after the output for each test case.
The first line contains T, the number of test cases.
Each test case contains a line with the two integers, a and b.
It is guaranteed that all numbers in the output will fit in a 32-bit signed integer
-10^8 = a = 10^8
0 = b = 10^8
1=T=10
2
7 9
11 15
adding 7
adding 56
63
adding 11
adding 22
adding 44
adding 88
165
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll