WK5 - 37 Algorithm Number is Positive, Negative or Zero

  Рет қаралды 8,783

Code to Career

Code to Career

Күн бұрын

Пікірлер: 12
@AhmadiNetwork
@AhmadiNetwork 3 жыл бұрын
Exllent
@CodetoCareer
@CodetoCareer 3 жыл бұрын
Welcome!
@rakshit9930
@rakshit9930 4 жыл бұрын
Sometimes we initiate with 0...and some time we don't take 0.... what's the reason behind it?
@CodetoCareer
@CodetoCareer 4 жыл бұрын
Case 1: Where we MUST give initial value Let us say I need to find Sum of 1 + 2 + 3 + 4...N In this problem, it is MUST to take sum and give it initial value ZERO. Reason being Sum = Sum + 1 then Sum = Sum + 2... so on till N. If we fail to give sum a value of zero, the computer assigns a RANDOM value to SUM. The value for sum could be -400 , 664 etc. Now if you fail to give sum as ZERO then obviously the final answer of the series summation is going to be incorrect. Case 2: num // to read odd or even number Suppose I want to find out if a number is odd or even. My next step would be.. Read num. Here the initial value is of no consequence since I am going to read a value into num. But a general rule of thumb as a good practice is to initialize all variables to zero so that we can quickly find out errors in the code, since we know that the initial value was zero. Hope this makes it clear.
@rakshit9930
@rakshit9930 4 жыл бұрын
@@CodetoCareer yes now my doubt is clear...thanku
@MeGamerr
@MeGamerr 4 жыл бұрын
sir in previous lectures u were writing "write " but in ongoing lectures u r writing "print"
@CodetoCareer
@CodetoCareer 4 жыл бұрын
kzbin.info/www/bejne/b3q5lot3Zs-fars Watch this around 3:00 mins, Do not skip the sequences...
@sarifurahman5647
@sarifurahman5647 3 жыл бұрын
Plz make a flow chart of it.
@CodetoCareer
@CodetoCareer 3 жыл бұрын
You may visit this link kzbin.info/www/bejne/o4vJf2t8oZWCiJI Go to this channel and look at the video tab you shall see all the flowcharts you require.
@rohitchhetri6302
@rohitchhetri6302 4 жыл бұрын
Sir can we use elif in place of else if?
@CodetoCareer
@CodetoCareer 4 жыл бұрын
In companies of course. During this course better avoided as may create confusion.
@rohitchhetri6302
@rohitchhetri6302 4 жыл бұрын
@@CodetoCareer thank you sir
WK5 - 38 Algorithm Smallest of three Numbers
8:12
Code to Career
Рет қаралды 10 М.
Lec 5: How to write an Algorithm | DAA
11:53
Jenny's Lectures CS IT
Рет қаралды 1 МЛН
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 62 МЛН
How to Remember Everything You Read
26:12
Justin Sung
Рет қаралды 2,1 МЛН
The sequence that grows remarkably large, then drops to zero!
17:28
If you're ambitious but lazy, please watch this video...
12:57
Mark Tilbury
Рет қаралды 130 М.
LLM creates animations using my voice
13:10
Bog
Рет қаралды 27 М.
How to STUDY so FAST it feels like CHEATING
8:03
The Angry Explainer
Рет қаралды 2,4 МЛН