please put three integers: 10 5 100 // this is the input
: 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90
95 100 // this is output
#include <cstdio>
#include <math.h>
int main()
{
int number, number2, number3, number4;
printf("Enter three integer:");
scanf("%d%d%d", &number, &number2, &number3);
for(int e = 0; e<number3; e++ )
{
if(number<number3){
number = number + number2;
printf("%d ", number);
}
}
}
when I try to print the output15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100
I try to print output "10" not showing up but when I try to make a change it keeps getting an error or wrong number. can someone guide me this?
Last edited on
Perhaps if you named your variables
int start, increment, end;
Then a for loop of
for ( e = start ; e <= end ; e += increment )
would seem a lot more obvious.
thank @salem I appreciate your help been stuck this problem for 2 hours more now.