Random Student ID Generator and Other C Programs
Task 1
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define N 5
#define N1 80
#define N2 35
int main() {
int counter;
int major_code, number;
srand(time(NULL));
counter = 0;
while(counter < N) {
major_code = rand() % 2;
if(major_code) {
number = rand() % N1 + 1;
printf("20256343%04d\n", number);
}
else ...
Posted on Thu, 07 May 2026 21:53:45 +0000 by thedotproduct