C language rand random function problems

EDITORIAL:
Hello everyone, I'm Huagou Fdog , from a small city in Inner Mongolia, currently studying in Taizhou.
I am grateful to have such a platform for me to share what they have learned and feel here.
I like programming, like the code, I like to do a programmer.
Study hard, after years of struggle, give loved ones a better life.
QQ / WX: 2506897252 welcomed the exchange.

rand random function parameters

I believe there are many novice like me will not use the rand function, do not know how to determine the parameters of the online answer is a bit complicated, I'm sure this is the method parameters, want to help novice it.

int code = rand() % a + b;
//这里的a就是生成区间最大数,而b就是区间最小数

If not, welcome that and look forward to my next article.
Each text sentence: If you would go up high, then use self legs! Not let yourselves carried aloft; not sitting in other people's backs and heads.

Published 15 original articles · won praise 41 · views 6149

Guess you like

Origin blog.csdn.net/Fdog_/article/details/102757038