ProAnswers.org

Write a C program to perform multiplication of two integers by using repetitive addition?

#include

#include 

#include 

void main() 

{ 

int a,b,c=1,d=0; 

clrscr(); 

printf(“

enter two numbers:”);

scanf(“%d%d”, &a, &b); 

for(;;) 

d=d+a; 

if(c= =b) 

goto stop; 

c++; 

} 

Stop: 

printf(“Multiplication of %d * %d:%d”,a,b,d); 

getch(); 

} 

Output: 

Enter two numbers: 8 4 

Multiplication of 8 *4 : 32