Nếu muốn nó thay đổi phải thêm hàm randomize(); vào. Như thế này nè:
Nhớ đưa code vào tag nhé.Code:#include<stdio.h> #include<conio.h> #include<stdlib.h> void main() { int a,b; randomize(); a=rand(); b=random(30); printf("a=%d",a); printf("b=%d",b); getch(); }