True/False

Is this correct?



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
int main ()

{
	int i = 4;
	int j = 3;
	bool true_false;

	true_false = (j<4);	//true
	true_false = (j<3);	//true
	true_false = (j< 1);	//false
	true_false = (i< 4);	//false
	true_false = (j <=4);	//false
	true_false = (4> 4);	//true
	true_false = (i != j);	//false
	true_false = (i == j || < 100);	//true
	true_false = ( i == j && i < 100 );	//true
true_false = ( i < j || true_false && j >= 3);//false
	true_false = ( ! ( i > 2 && j == 4);	//false
	true_false = !1;//true

	return 0;

}

Last edited on
line 15: you need to put something between || and <
line 20: you missed closen parenthesis.
line 19 (and other ones): I strongly recommend you to use parentheses to make sure that the order of operators is right.

and line 12: 3 <= 4 will be true actually
lines 2, 13, 14, 16, 17, 18, 19: comment also wrong
true_false = (j<3); false
Topic archived. No new replies allowed.