What is the reason when we add #include<ctime> in our code and cout<<time(0)<<endl; always outputting random numbers | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 3

What is the reason when we add #include<ctime> in our code and cout<<time(0)<<endl; always outputting random numbers

27th Nov 2018, 4:44 PM
Faruq
Faruq - avatar
3 Respostas
0
Š­Š¼ ŠæрŠøŠ²ŠµŃ‚
8th Dec 2018, 4:12 PM
ŠšŠ¾Š»Ń
0
Because this will take current time of system and time can never b same in your case. That's why it always generates random numbers.
13th Dec 2018, 7:43 AM
Jawad Adil
0
hello
16th May 2019, 3:12 AM
suxrob