# Beginner in C facing problem

• 10-30-2007
paushali
Beginner in C facing problem
Hi!
Could you plz help me in the following question:
"Write an interactive program to demonstrate the process of multiplication.The process should ask the user to enter two 2-digit numbers(integers) and print the product of the integers as shown below:

45
x 37
--------------
315 (7x45)
135 (3x45)
---------------
---------------
• 10-30-2007
laserlight
What have you tried?
• 10-30-2007
hk_mp5kpdw
For the example provided, you'd need to split the bottom multiplier 37 into it's component pieces 3 and 7. This can be done with some simple math using division (/) and modulus (&#37;) operators: What is 37 / 10? What is 37 % 10?
• 10-30-2007
paushali
#include <stdio.h>
void main()
{
int ax,by,a,b,c,d,e;
printf("Enter any two 2-digit integers");
scanf("&#37;d %d",&ax,&by);
c=ax*(by-10*b);
d=ax*((by-y)/10); /*here I have broken 37 as
scanf("%d %d",&c,&d); 3*10+7 i.e" by=10b+y"*/
e=c+10*d;
printf("The product is %d",e)