1bool isCodingFun = true;
2bool isFishTasty = false;
3cout << isCodingFun; // Outputs 1 (true)
4cout << isFishTasty; // Outputs 0 (false)
5
6//credit to w3schools.com
1#include<stdio.h>
2#include <stdbool.h>
3main() {
4 bool value = true;
5 (value) ? printf("value is true"): printf("value is false");
6}
1bool Divisible(int a, int b) {
2 int remainder = a % b; // Calculate the remainder of a and b.
3
4 if(remainder == 0) {
5 return true; //If the remainder is 0, the numbers are divisible.
6 } else {
7 return false; // Otherwise, they aren't.
8 }
9}