In this C program we will calculate the multiplication of two numbers(integers) using addition method and print the result, in the screen. The two numbers(integers) will be taken from the user.color>
input:
The two numbers(integers) (i.e. 5,10,7 etc.)output:
The multiplication of the two numbers will be printed on the screen.CODE---->
#include
#include
color>main(){
int num1,num2,mul=0,i=1;
printf("Enter the first number : color>");
scanf("%dcolor>",&num1);
printf("\nEnter the second number : color>");
scanf("%dcolor>",&num2);
while(i)
{
mul=mul+num2;
i++;
}
printf("\n\n The result is : %d * %d = %dcolor>",num1,num2,mul);
getch();
}
color>