#include <stdio.h>
int main()
{
int n, b, a;
int x, verificador, total;
total = 0;
/* first value of the range */
printf("digite o primeiro numero do intervalo\n");
scanf("%d", &a);
/*second range value */
printf("digite o ultimo valor do intervalo\n");
scanf("%d", &b);
/*value to be tested from multiple */
printf("digite o valor a testar seeh multiplo\n");
scanf("%d", &n);
/* x is the value that starts the count, a goes to the value of b (end of interval, where always sum 1
each time you perform the test if you belong to the range the loop checks whether the verifier variable receives the rest of the x (counter) division by the multiples,
if the checker result receives the value 0, it means that x is divisible by n, which is what will be run by the following test on if, then if checker is
0, will be printed on the screen the value of x, in the code I left commented the total variable, which is a counter of how many times this occurs inside the loop, if necessary */
for(x = a; x <= b; x = x +1)
{
verificador = x % n;
if(verificador == 0)
{
printf("%d eh multiplo de %d\n", x,n);
//total = total + 1;
}
}
//printf("the code found %d results", total);
}
Please format your code for better viewing, stackoverflow is using the markdown syntax
– Danizavtz
thank you by the tip!
– Diego Borges de Oliveira