ok first of all, i hoping this readable,
wrong at this line after the curly brackets,Code:int main() { int x; int y; int n; int holdin; int result=0; printf("First Value ="); scanf("%d",&x); printf("Divide Value ="); scanf("%d",&y); printf("Looping Times ="); scanf("%d",&n); for(int m=1;m<n;m=m+1){ holdin=x+(m-1)*y; result=result+holdin; printf("%d+",holdin); } holdin=x+(m-1)*y; result=result+holdin; printf("%d=%d",holdin,result); }
it says '-fpermissive' again like the older thread with loop problem that i began to with the loop problems,Code:holdin=x+(m-1)*y;
the reason i am adding the new line after curly brackets it because
if the loop times was 5
it only count up 4 times because
int m=1 not 0 and the increment only 4 times with the final result m=5Code:for(int m=1;m<n;m=m+1)
but when i adding the line, "-fpermissive" thing comes up,
any ideas?



LinkBack URL
About LinkBacks



