All pastes #558941 Raw Edit

Someone

public text v1 · immutable
·published 2007-06-11 15:53 UTC
rendered paste body

/* Includes */

#include<stdio.h>
#include<stdlib.h>

//Global variable decleration

char a[3][5]={"ALIVE","SICK","FAIL"};    // Array holding the 3 different health status`s.
int i;

//Function to generate a random health status.

void health()
{
 i=0;
 i = rand() % 3;                          // Generates a random number between 1 and 3.
 printf("%s \n",a[i]);
}

main()
{
 health();
}