- Joined
- Dec 10, 2022
- Messages
- 2
- Reaction score
- 0
Greetings guys,
While doing do while exercice
#include <stdio.h>
int main()
{
int i=0;
do
{
printf("%d hello\n",i);
i=i+1;
}
while(i<=5);
it works well but when I do the following
#include <stdio.h>
int main()
{
int i=0;
do
{
printf("%d hello\n",i);
}
while(i<=5);
i=i+1;
the program enters in a kind of infinite loop
Why is that?
thank you!
While doing do while exercice
#include <stdio.h>
int main()
{
int i=0;
do
{
printf("%d hello\n",i);
i=i+1;
}
while(i<=5);
it works well but when I do the following
#include <stdio.h>
int main()
{
int i=0;
do
{
printf("%d hello\n",i);
}
while(i<=5);
i=i+1;
the program enters in a kind of infinite loop
Why is that?
thank you!