// Logical operators
#include <cs50.h>
#include <stdio.h>
int main(void)
{
// Prompt user for answer
char c = get_char("Answer: ");
// Check answer
if (c == 'Y' || c == 'y')
{
printf("yes\n");
}
else if (c == 'N' || c == 'n')
{
printf("no\n");
}
}
answer.c #CS50
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.