dude, i pretty much gave you your first function in your other, identical post.
i just forgot to make the expression c/c++ readable by adding the implied multiplication in
Y*n-1+1/3[X*n+1+4X*n+X*n-1]
since you didn't pay attention the first time, i'll do it again but without the incrementing loop. oh yea, i didn't bother testing this either - it just seems like a waste of time.
[code]
#include <stdio.h>
Code:
int main(void)
{
int X;
int Y;
flush(stdin);
printf("Enter X: ");
scanf("%d", &X);
printf("Enter Y: ");
scanf("%d", &Y);
int n = 1;
int result = Y*n-1+1/3[X*n+1+4X*n+X*n-1];
printf("Given X = %d, Y = %d, and n = %d", X, Y, n);
printf("The result of Y*n-1+1/3[X*n+1+4X*n+X*n-1] is ");
printf(" %d\n", X, Y, n);
n = 2;
printf("Given X = %d, Y = %d, and n = %d", X, Y, n);
printf("The result of Y*n-1+1/3[X*n+1+4X*n+X*n-1] is ");
printf(" %d\n", X, Y, n);
return 0;
}