In this code I'm generate random number in specific range, but I want the out put of array must be
m1,m1,m3,m1 ..
I mean adding the word "host" to every number that is generate randomly, how can do this please? this is code
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main (int argc, char *argv[])
{
int a[50];
srand(time(NULL));
a[i] = rand() % (3 + 1 - 1) + 1 ;
printf( " %d\n", a[i]);
}
snprintf().printf()? And who is upvoting this, and why?