Please can you help me,
I am trying VERY hard to get the program (below) to work, but I cannot get the IF statement to work.
The program should print a CALEY table, so when the 'b' variable gets to 9 it resets to 1. However, The only place I can put it in the program comes up with an EXPRESSION SYNTAX error.
I REALLY hope you can help.
(I highlighted the problem line for your ease).
Thank-you, Rob.
#include <stdio.h>
#include <conio.h>
int main (void)
{
int a = 1;
int b = 1;
int c = 1;
int d = 1;
clrscr();
printf("Cayley Table\n\r");
while (a<=8)
{
b=d;
for (c=1; c<=8
printf("%d",b) ,b=b+1, if (b>8)b=1 ,c=c+1;
printf("\n");
d=d+1;
a=a+1;
}
getch();
return 0;
}