알고리즘 29 - Convert a Boolean to a String

tamagoyakii·2021년 10월 10일
0

알고리즘

목록 보기
29/89

Q.

Implement a function which convert the given boolean value into its string representation.

Note: Only valid inputs will be given.

A)

#include <stdbool.h>

const char *boolean_to_string(bool b) {
  return b ? "true" : "false";
}

0개의 댓글