C Problem 3 on page 308 of Nyhoff and Leestma. C C Prompt the user for two three-digit numbers (integers). Assuming C the user entered 749 and 381, the program should print the C multiplication in the following format: C C 749 C X 381 C ------ C 749 C 5992 C 2247 C ------ C 285369 C C John Schneider C CptS 203, HW 5, problem 1 C-------------------------------------------------------------------------- program dspmul implicit none integer top, bot, units, tens, hndrds C..... C top = the "top" number to be multiplied C bot = the "bottom" number to be multiplied C units = the units digits in the bottom number C tens = the tens digits in the bottom number C hndrds = the hndrds digits in the bottom number C..... print *, 'Enter two three digit numbers (integers).' read *, top, bot C..... C Note that in all the format specifiers which follow the 't' C descriptor could be replaced with an 'x' descriptor. (If that C were done, the number following the descriptor would have to be C increased by one to keep the output in the same place.) C..... C.....Write the numbers to be multiplied. print '(t6,i3)', top print 10, bot C.....Instead of using 6('-'), could use '------' -- same result. 10 format(t2,'X ',i3/t3,6('-')) C.....Result of units multiplication. units = mod(bot,10) print '(t5,i4)', top*units C.....Result of tens multiplication. tens = mod(bot/10,10) print '(t4,i4)', top*tens C.....Result of hundreds multiplication. hndrds = mod(bot/100,10) print '(t3,i4)', top*hndrds C.....The result of the full multiplication. print 20, top*bot 20 format(t3,6('-')/t3,i6) stop end