C Program to Generate Random Numbers with in a Range of values

C Program to Generate Random Numbers with in a Range of values

LearningLad

4 года назад

109,310 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@shalemjeldi9654
@shalemjeldi9654 - 24.01.2024 16:15

Bro thankyou bro

Ответить
@deepblackoutlaw9640
@deepblackoutlaw9640 - 02.10.2023 22:35

People wondering why the formula worked 💀

Ответить
@evertonsston
@evertonsston - 30.07.2023 03:22

Another tip is to use process id function("getpid()") multiplied by time function to get specific random number from process. So even if you use a script that runs the same program multiply times in the same second, it will generate random different numbers.

Ответить
@mathematicsmadeeasier5190
@mathematicsmadeeasier5190 - 05.05.2023 07:40

It shows the number of seconds elapsed. Then it is not really random number, it is an increasing sequence of numbers. What if we want to get 500, then 4 then 2100 and so on?

Ответить
@balkrishnakc9967
@balkrishnakc9967 - 17.03.2023 18:54

I really appreciate for your teaching that you provide all the bug and solutions ❤

Ответить
@nimaibarman1828
@nimaibarman1828 - 22.01.2023 12:45

Thanks.

Ответить
@helloworld1637
@helloworld1637 - 18.12.2022 08:21

Nice man..

Ответить
@deltagaming2103
@deltagaming2103 - 08.12.2022 00:00

thanks

Ответить
@SD-kw7yf
@SD-kw7yf - 24.11.2022 11:15

Some application they pick up the code randomly but some don't which university should I join standford or peninsula

Ответить
@siradjmounirlamri9663
@siradjmounirlamri9663 - 04.11.2022 03:15

Thank you

Ответить
@himankjeshwar8636
@himankjeshwar8636 - 16.10.2022 20:18

SUMARRY :
Formula for 0 to n : rand()%n
Formula for m to n : rand()%(n-m+1)+m
where m is the lower limit and n is the upper limit.

Ответить
@tanaymithari4902
@tanaymithari4902 - 25.09.2022 11:48

i still didnt understand range formula

Ответить
@sayukichannel8094
@sayukichannel8094 - 17.09.2022 17:30

wow, your explanation is fantastic, you just made my learning C programming more enjoyable.

Ответить
@arunfernandez1999
@arunfernandez1999 - 22.08.2022 21:10

nice video great

Ответить
@studyWithJun473
@studyWithJun473 - 22.08.2022 13:51

thanks bro. easy to understand . no bullshit , straight away got to the point. love it

Ответить
@harshrawat029
@harshrawat029 - 20.08.2022 17:02

Can we generate different random numbers in a single run like if we write this in a for loop that is executing let say 20 times so is there a way to get different random numbers with every iteration of the loop? Actually I tried it with your specified method which is very helpful btw, but I need different random number with every single execution of the loop.

Edit: I got it, We just need to do srand(time(NULL)+i) to get it done, it will change the seed for every iteration. Thank You so much for this video @LearningLad

Ответить
@mianirfanullah8623
@mianirfanullah8623 - 14.07.2022 00:55

How to generate complex random numbers

Ответить
@argentinidomador7239
@argentinidomador7239 - 07.07.2022 04:17

Thanks for your video, this help me a lot :D

Ответить
@ostapfedchuk4652
@ostapfedchuk4652 - 26.06.2022 12:03

bro thanks you very much

Ответить
@amirtech5386
@amirtech5386 - 18.05.2022 20:50

If i want between 1 to 10 which logic i can you

Ответить
@joelmarkjmj1591
@joelmarkjmj1591 - 11.05.2022 21:20

Thank you for debugging my code sir

Ответить
@joelmarkjmj1591
@joelmarkjmj1591 - 11.05.2022 21:20

Hats off for your explanation sir
&
You're the only one who says to dislike the video if we don't like it

But I've became a huge fan of your explanation sir. that's really crystal clear sir...thank you for debugging my code sir

Ответить
@360ibra2
@360ibra2 - 28.04.2022 00:38

THANK YOU!!

Ответить
@theturkish1373
@theturkish1373 - 19.04.2022 05:53

Cheers mate!

Ответить
@kinanradaideh5479
@kinanradaideh5479 - 08.04.2022 15:28

what font is he using?

Ответить
@theglitch9495
@theglitch9495 - 26.03.2022 16:20

How can i make the program choose randomly from what the user puts in ?

Ответить
@TN7.
@TN7. - 07.02.2022 16:03

great video !!!!!

Ответить
@reeteshtripathi
@reeteshtripathi - 24.01.2022 12:18

Amazing.

Ответить
@monika2145
@monika2145 - 23.01.2022 02:35

Sooo much thank you:)

Ответить
@hexothermus7104
@hexothermus7104 - 20.01.2022 17:37

Thanks for your help bro

Ответить
@danielceka5247
@danielceka5247 - 17.01.2022 20:18

Thank you man you saved me

Ответить
@deeptangshudutta5764
@deeptangshudutta5764 - 11.01.2022 20:52

Thank You. I was literally stuck on this rand() function for days. And cussing it too😅😓. And now I know it. Thanks Once again😄♥♥

Ответить
@aqsamohsin4954
@aqsamohsin4954 - 07.01.2022 03:30

Kak samj ni aaai🤔😑

Ответить
@Simouna
@Simouna - 09.12.2021 20:20

I would like to ask if the random number is let's say 400, wouldn't the resulting no. equal to 4? or are we to assume that it would always be bigger than that?

Ответить
@pozeraczstivow6348
@pozeraczstivow6348 - 25.11.2021 15:32

Thanks man!!!!!!!!!

Ответить
@Ishpard
@Ishpard - 17.11.2021 23:41

If i want to create 100 random values at the same time, they end up being the same. Am i missing something? What can i do to get around this?

Ответить
@nikkowh
@nikkowh - 11.11.2021 12:00

Yo man, thanks for vid, i think i passed just thanks to you <3

Ответить
@williamhong6819
@williamhong6819 - 07.11.2021 20:30

Thank you so much, this really helped me with my assingment!!!!!!!
Love you my man😘

Ответить
@junwang8419
@junwang8419 - 06.11.2021 10:38

how do we make low and upper is double number like 0.50 how do we do

Ответить
@Vutsman1
@Vutsman1 - 04.11.2021 01:44

What if you need a random number from 1 to 1 million, with a seed 179. The first iteration is 545994 but I can't get it.
I'd like to know how to do this.

Ответить
@Sneaadler
@Sneaadler - 20.10.2021 18:36

Thanks Thanks Thanks

Ответить
@sarba85528
@sarba85528 - 01.10.2021 21:57

Thank you so much!! Please don't thank me for watching :)

Ответить
@poojaheera5980
@poojaheera5980 - 29.09.2021 21:50

😊 thanks

Ответить
@aalim1282
@aalim1282 - 17.09.2021 14:53

Thank you brother

Ответить
@jahzielperalta484
@jahzielperalta484 - 11.09.2021 11:51

I want 1 to 10 only but I still get one zero I follow the exact code. But either way ty so much I am gonna use it for a mini-game practice

Ответить
@syedashrafahamed6003
@syedashrafahamed6003 - 26.08.2021 09:21

Bro which software you are using

Ответить
@souravpandey1982
@souravpandey1982 - 19.08.2021 05:03

Good job brother ❤️

Ответить
@VishalSharma-jx9in
@VishalSharma-jx9in - 07.08.2021 08:32

thanks bro
that video was amazing

Ответить
@die-hardotaku2570
@die-hardotaku2570 - 05.07.2021 19:00

"It can only generate 1 random number at once "....

If you print that "number" variable more than once , it shows the same numbers...


so this program can only generate only one random number at once....

But previous video where you taught about 1970, Jan 01 time elapsed technique, we could generate more than one random number by printing again and again...this doesn't work, why???

Ответить
@Hustlah-
@Hustlah- - 26.06.2021 20:39

thank you sir

Ответить