Video Link: https://youtu.be/TybmJxXRV80 Tutorial Link: https://www.programiz.com/c-programming
#include <stdio.h>
#include <stdbool.h>
int main() {
bool value1 = true;
bool value2 = false;
printf("%d ", value1);
printf(" %d", value2);
return 0;
}
Output
1 0
> Greater than
< Less than
== Equal to
>= Greater than or equal to
<= Less than or equal to
!= Not equal to
#include <stdio.h>
#include <stdbool.h>
int main() {
bool value = (12 > 9);
printf("%d ", value);
return 0;
}
Output
1
#include <stdio.h>
#include <stdbool.h>
int main() {
bool value = (5 > 9);
printf("%d ", value);
return 0;
}
Output
0
#include <stdio.h>
#include <stdbool.h>
int main() {
bool value = (5 < 9);
printf("%d ", value);
return 0;
}
Output
1
#include <stdio.h>
#include <stdbool.h>
int main() {
bool value = (9 < 9);
printf("%d ", value);
return 0;
}
Output
0
#include <stdio.h>
#include <stdbool.h>
int main() {
bool value = (9 == 9);
printf("%d ", value);
return 0;
}
Output
1
#include <stdio.h>
#include <stdbool.h>
int main() {
bool value = (9 == 6);
printf("%d ", value);
return 0;
}
Output
0
#include <stdio.h>
#include <stdbool.h>
int main() {
bool value = (9 != 6);
printf("%d ", value);
return 0;
}
Output
1
#include <stdio.h>
#include <stdbool.h>
int main() {
bool value = (9 >= 6);
printf("%d ", value);
return 0;
}
Output
1
#include <stdio.h>
#include <stdbool.h>
int main() {
bool value = (9 <= 6);
printf("%d ", value);
return 0;
}
Output
0
#include <stdio.h>
#include <stdbool.h>
int main() {
bool value = (9.34 <= 6.87);
printf("%d ", value);
return 0;
}
Output
0
#include <stdio.h>
#include <stdbool.h>
int main() {
int num1 = 9;
int num2 = 6;
bool value = num1 > num2;
printf("%d ", value);
return 0;
}
Output
1
#include <stdio.h>
#include <stdbool.h>
int main() {
int num1 = 9;
bool value = num1 > 6;
printf("%d ", value);
return 0;
}
Output
1
&& Logical AND
|| Logical OR
! Logical Not
#include <stdio.h>
#include <stdbool.h>
int main() {
int age = 18;
double height = 6.3;
bool result = (age >= 18) && (height > 6.0);
printf("%d ", );
return 0;
}
Output
1
#include <stdio.h>
#include <stdbool.h>
int main() {
int age = 16;
double height = 6.3;
bool result = (age >= 18) && (height > 6.0);
printf("%d ", );
return 0;
}
Output
0
#include <stdio.h>
#include <stdbool.h>
int main() {
int age = 16;
double height = 6.3;
bool value = (age >= 18) || (height > 6.0);
printf("%d ", value);
return 0;
}
Output
1
#include <stdio.h>
#include <stdbool.h>
int main() {
int age = 16;
bool value = !(age >= 18);
printf("%d ", value);
return 0;
}
Output
1
#include <stdio.h>
#include <stdbool.h>
int main() {
int age = 16;
bool value = !(age <= 18);
printf("%d ", value);
return 0;
}
Output
0
Q. Which of the following code returns false?
Options:
- 9 >= 9
- 9 > 9
- 9 <= 9
- 9 == 9
Answer: 2