program:
#include<stdio.h>
#include<stdlib.h>
int main()
{
int n;
n=rand()%10;
printf("%d",n);
output:
2
7
1
8