This is a very simple program that generates a even random number.
#include <stdio.h> #include <stdlib.h> #include <time.h> int main () { for(int i = 0;i<100;i++){ int ret = (rand()%10)/2*2; printf("%d\n",ret); } return 0; }