Today I wrote a code for finding digital root of a number for college assignment, I wrote the code for it using the description of digital root given in the question itself. Here is what I wrote
but while searching internet for more details about digital root I came across this
sometimes codes like this makes me realise how computer science is a sub field of mathematics (which I am terrible at) and makes me question my carrier choice
int dr(int n)
{
int sum = 0;
while(n)
{
sum += n % 10;
n /= 10;
}
return (sum / 10 == 0) ? sum : dr(sum);
}
but while searching internet for more details about digital root I came across this
int digital_root(int Z)
{
return --Z % 9 + 1;
}
sometimes codes like this makes me realise how computer science is a sub field of mathematics (which I am terrible at) and makes me question my carrier choice
> its weekend
> have English extra class at 8 am
> The English teacher is unable to connect to wifi
> she starts telling how women are exploited because she is not able to connect to wifi
> have English extra class at 8 am
> The English teacher is unable to connect to wifi
> she starts telling how women are exploited because she is not able to connect to wifi
If Life is a async loop then I am on await since 2020, stuck with no callback to resume back to normalcy
Not Safe For Brain
https://www.youtube.com/watch?v=B5TD3Ch2TG4
On a side note
“Do not believe in anything simply because you have heard it. Do not believe in anything simply because it is spoken and rumored by many. Do not believe in anything simply because it is found written in your religious books. Do not believe in anything merely on the authority of your teachers and elders. Do not believe in traditions because they have been handed down for many generations. But after observation and analysis, when you find that anything agrees with reason and is conducive to the good and benefit of one and all, then accept it and live up to it.”
― Buddha
“Do not believe in anything simply because you have heard it. Do not believe in anything simply because it is spoken and rumored by many. Do not believe in anything simply because it is found written in your religious books. Do not believe in anything merely on the authority of your teachers and elders. Do not believe in traditions because they have been handed down for many generations. But after observation and analysis, when you find that anything agrees with reason and is conducive to the good and benefit of one and all, then accept it and live up to it.”
― Buddha