1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| #include <stdio.h>
void under_construction(){ printf("This is under development\n"); }
void print_msg(char *user){ char formatter[0x20]; strncpy(formatter, user, 5); for (size_t i = 0; i < 5; i++) formatter[i] = tolower(formatter[i]); printf(strncmp(formatter, "admin", 5) == 0 ? "\nWelcome admin!\n\n" : "\nWelcome user!\n\n"); }
int main(int argc, char **argv){ char name[0x20] = {0}; unsigned long x, y; printf("Enter your name: "); scanf("%s", name); print_msg(name); return 0; }
|