Write a program that reads several boolean values and prints their negation.
Input will consist of several lines containing either
Output should contain a line with the negation of the given value:
The submitted program should contain a
that receives one boolean as argument and returns a boolean.
Please refer to the information for the chosen language:
int negation(int p);
negation :: Bool -> Bool
bool negation(bool p);
In Python and Haskell,
you can compare strings
s2 using the equality operator:
s1 == s2
This operator also works with literal strings:
str == "hello"
In C, you can compare strings using the
strcmp(s1, s2) == 0
When the result of
strcmp is 0 that means the given strings are equal.
strcmp function also works with literal strings:
strcmp(str, "hello") == 0
try next: bool-and-or
Copyright © 2020-2021 Rudy Matela
All rights reserved