C Program to generate random numbers

Problem Statement

Write a program in C to generate 10 random number between 1 and 100.

C Program to generate random numbers 

#include <stdio.h> 
#include <stdlib.h> 
int main()  
{ 
        int i, n; 
        printf("10 random numbers between 1 and 100\n"); 
    
        for (i = 1; i <= 10; i++)  
        { 
             n = rand()%100 + 1; 
             printf("%d\n", n); 
        } 
        return 0; 
}