Skip to content

Instantly share code, notes, and snippets.

@skrite0
Last active August 29, 2015 14:13
Show Gist options
  • Save skrite0/3f3d306600340aec43a4 to your computer and use it in GitHub Desktop.
Save skrite0/3f3d306600340aec43a4 to your computer and use it in GitHub Desktop.
RNameG
/*
* 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