if(a%3 == 0 && a>3)
I forgot what back 2 back equals signs was?
#include <stdio.h>
int main(){
int a;
int b = 4 ;
int c;
b*=b;
for (a =1; a<b; ++a)
{
if(a%3 == 0 && a>3)
{
for (c=0; c< a-8 ;c++)
{
printf("%d\n", c);
}
}
}
system("pause");
return (1);
}
The output is this
0
0
1
2
3
0
1
2
3
4
5
6
regards!
if(a%3 == 0 && a>3)
I forgot what back 2 back equals signs was?
Mad_Haggis, == is comparison operator, while single equal sign assigns value. i.e. a=3 would assign 3 to a, while a == 3 checks whether a equals 3. Then there are tripple comparison operators, like ===, !=== as well.
This line actually means: if "a" is divisible by 3 (if when we divide it by 3 the remainder is zero), and if "a" is greater than 3 ...
Bookmarks