#include <cs50.h> #include <stdio.h> int main(void) { // ask for an integer printf("how old are you?\n"); int n = GetInt(); // analyse users input if (n >= 1 && n <= 12) { printf("you're still a baby\n"); } else if (n >= 13 && n <= 19) { printf("you're a teenager\n"); } else if (n >= 20 && n <= 39) { printf("adult?\n"); } else if (n >= 40 && n <= 100) { printf("Damn, you old!\n"); } else if (n > 101) { printf("How are you not dead?\n"); } }
#include <stdio.h> #include <cs50.h> #include <string.h> int main(void) { // choose a planet printf("Choose a planet\n"); if (strncmp = "Mercury") { printf("Mercury takes 87.9 Earth days to complete its orbit around the Sun"); }</string.h></cs50.h></stdio.h></stdio.h></cs50.h>
if (strncmp = "Mercury")
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)