C Programming

What is code means: first it ask you (“What is your last name?”) then you type your name in…. So when you type your name in it will divide you into Blue or Red Team.

1  #include <stdio.h>
2  #include <stdlib.h>
3  int main(){
4   char lastname[20];
5    printf("What is your last name?");
6    scanf(" %s", lastname);
7
8    (lastname[0] > ('M')) ? printf("Blue Team\n"): printf("Red Team\n");
9
10   int friends;
11   printf("How many friend do you have?");
12   scanf("%d", &friends);
13
14   printf("I have %d friend%s\a\n", friends, (friends!=1) ? "s":"");
15   return 0;
16  }
17