-5

This is how you print a bool. One value is set true and one is set to false. Not sure why it wouldn't print before.

#include <stdio.h>
#include <stdbool.h>

int main(void) {

    bool intersect = true;
    bool intersect1 = false;
    printf(" Intersection is %d \n", intersect);
    printf(" Intersection1 is %d \n", intersect1);
    return 0;
}
cokedude
  • 379
  • 1
  • 11
  • 21

1 Answers1

3

This should do it:

printf("%s", intersect ? "true" : "false");
Raptor
  • 53,206
  • 45
  • 230
  • 366
ipavl
  • 828
  • 11
  • 20