Let's review this question & try to understand what's the logic behind it....
Let's go.......... ๐ฅ๐ฅ๐ฅ
๐งตโ
Before jumping onto the answer, Let's understand what is "Increment" Operator (++)
The increment operator (++) increments (adds one to) its operand and returns a value.
Let's try to understand with an example โ
{1/6}
Now you know ++ operator, Let's understand what is "Postfix" & "Prefix" Increment.
โข Prefix Increment (++a) - It (adds one to) its operand and "then" returns a value.
Let's see a quick example โ
{2/6}
Now you know what is Prefix, Let's see the what is Postfix Increment.
โข Postfix Increment (a++) - It return the value first & then (adds one to) its operand.
Let's see a quick example โ
{3/6}
Let's see a quick difference between both of them โ
โข Prefix: adds up & then return the value.
โข Postfix: returns first & then adds up the value.
{4/6}
Let's now see our solution to the problem:-
=> Answer was 26
Let's see how {Part-1} โ
{5/6}
Problem Solution {Part-2} โ
{6/6}
That's it for this thread. Hope you liked it. ๐๐ผ
- Hii I'm Aakash. ๐๐ฝ
- Sharing my journey and learnings. ๐
If you liked it, then you can follow me, @Aakash_Codes for more such content & resources.
Thanks for the support.๐
Back to top:-
Share this Scrolly Tale with your friends.
A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.