Computer Science, asked by Lajithkumar, 1 month ago

write an algorithm to find the product of counting numbers between two numbers entered by the user .
The two numbers
( 10 < = 20 ). ​

Answers

Answered by ashazaliazhar1010
2

#include<stdio.h>

void main(){

int i, a, b, c[100], d ,ans;

printf("enter a number");

scanf("%d",&a);

printf("enter another number (more than previous one)");

scanf("%d",&b);

d=0;

for (i=a+1; i<b; i++){

 c[d] = i;

 d++;  

}

ans = 1;

for (d = 0; d<b-a-1; d++){

 printf("%d \n",c[d]);  

}

for (d = 0; d<b-a-1; d++){

 ans = c[d] * ans;  

}

printf("%d",ans);

}

Answered by greeshmakachirayil
0

Answer:

Algorithm for two-number multiplication in C:

1) Start

2) Go with Choice 1

3) Go with Choice 2.

4) Add the two figures together.

5. Print out the results.

6. Final algorithm to multiply and publish the result of any two numbers:

What number is the first?

Which digit follows next?

Now multiply them to get the answer.

The first number, a *, the second number, a =, and then the product should be printed.

CODE:

#include<stdio.h>

void main(){

int i, a, b, c[100], d ,ans;

printf("enter a number");

scanf("%d",&a);

printf("enter another number (more than previous one)");

scanf("%d",&b);

d=0;

for (i=a+1; i<b; i++){

c[d] = i;

d++;  

}

ans = 1;

for (d = 0; d<b-a-1; d++){

printf("%d \n",c[d]);  

}

for (d = 0; d<b-a-1; d++){

ans = c[d] * ans;  

}

printf("%d",ans);

}

Learn more about the algorithm here:

https://brainly.in/question/3644675

Learn more about programming here:

https://brainly.in/question/14800524

#SPJ3

Similar questions