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; 
}

Leave a Reply

Your email address will not be published. Required fields are marked *

Liked this content?. Please spread the word :)

  • RSS
  • Twitter
    Visit Us
    Follow Me