Example & Tutorial understanding programming in easy ways.

Generate random number in between 0 to 10 in C langauge

program:


#include<stdio.h>

#include<stdlib.h>

int main()

{

int n;

n=rand()%10;

printf("%d",n);

n=rand()%10;

printf("%d",n);

n=rand()%10;

printf("%d",n);

n=rand()%10;

printf("%d",n);

}


output:

2

7

1

8

Read More →