Comma operator within While loop || #Video3 || Problem Solving Through C Language

preview_player
Показать описание
Join the channel of Telegram:-
Instagram :-
Facebook Page :-
Facebook Group:-
Linked in Profile Link:-

Follow me On Twitter:-
************************************************************************************
Previous video of this play list:-

OTHER PLAY LISTS
-----------------------------------------------------------------------------------------------------
C Programming:-

Operators in C :-

Problem Solving in C :-

DATA STRUCTURES:-

MATLAB :-

LOGIC GATES:-

HOW TO :-

Inspirational Stories:-

Important News :-

***************************************************************************************
Рекомендации по теме
Комментарии
Автор

follow this telegram channel for more recent updates and discussions on C Programming and Problem Solving Through C

PRITAMPAUL
Автор

In expression: while(i++, i<=8);
The value of i will be incremented and that incremented value will be compared to 8 even if it is a post increment.
Look at the code below!
#include <stdio.h>
int main()
{
int i=0, count=0;
while(i++, i<=8)
count++;
printf("%d", i);
printf("%d", count);
return 0;
}
Output: 98
That means loop runs 8 times only.
Try doing ++i then also it will be 8 times only.

My conclusion is
while(0, 1<=8);
while(1, 2<=8);
while(2, 3<=8);
.
.
So on.. is the right way of compiling a code!

As you said in video - while(0, 0<=8); while(1, 1<=8); while(2, 2<=8); ... and so on.. is not the right way because loop count is 8 not 9.
If you were right then the loop count must be also 9.

So please make a note of it. 😊
Thank you!

mahimarajvirsingh
join shbcf.ru