Last active
August 29, 2015 14:13
-
-
Save skrite0/3f3d306600340aec43a4 to your computer and use it in GitHub Desktop.
RNameG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* File: main.c | |
* Author: Anon | |
* | |
* Created on January 10, 2015, 11:11 AM | |
*/ | |
#include <stdlib.h> | |
#include <string.h> | |
#include <stdio.h> | |
/* | |
* | |
*/ | |
char names(int); | |
int main(int argc, char** argv) | |
{ | |
printf("Name : %s\n", names(rand() % (6 - 1) + 1)); | |
return 0; | |
} | |
char names(int num) | |
{ | |
char *name; | |
switch (num) | |
{ | |
case 1 : name = "Martin"; | |
case 2 : name = "Jordan"; | |
case 3 : name = "Avery"; | |
case 4 : name = "Max"; | |
case 5 : name = "Logan"; | |
case 6 : name = "Garry"; | |
default : name = "Invalid Input!"; | |
} | |
return *name; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment