[ create a new paste ] login | about

Link: http://codepad.org/bfNIeGpK    [ raw code | output | fork ]

C, pasted on Apr 20:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include<stdio.h>
#include<conio.h>
#include<time.h>
#include<stdlib.h>
int main()
{
	int a = 1, b = 10;

	srand(time(0));  // reset lại

	int x = a + rand() % (b - a + 1);
	printf("\nx = %d", x);

	_getch();
	return 0;
}


Output:
1
Line 17: error: conio.h: No such file or directory


Create a new paste based on this one


Comments: