29 lines
465 B
C
29 lines
465 B
C
// Comparing against lowercase and uppercase char
|
|
|
|
#include <cs50.h>
|
|
#include <stdio.h>
|
|
|
|
int main(void)
|
|
{
|
|
// Prompt user to agree
|
|
char c = get_char("Do you agree? ");
|
|
|
|
// Check whether agreed
|
|
if (c == 'y')
|
|
{
|
|
printf("Agreed.\n");
|
|
}
|
|
else if (c == 'Y')
|
|
{
|
|
printf("Agreed.\n");
|
|
}
|
|
else if (c == 'n')
|
|
{
|
|
printf("Not agreed.\n");
|
|
}
|
|
else if (c == 'N')
|
|
{
|
|
printf("Not agreed.\n");
|
|
}
|
|
}
|