no of times the loop runs

no of times loop will run on gcc , for c
while(i<n)
i++

and

do
i++;
while(i<=n)

I didn’t get your intention clearly behind this testing, but as we know, while is an entry controlled loop and do-while is an exit controlled loop, the former runs atleast zero times and latter atleast once. What I mean by entry controlled, is the condition in while loop is checked at the time of entry in the loop and it is checked at the time of exit in the do-while loop. Thus, the latter is executed atleast once. Run this cod ein your compiler and see the results:

    #include<iostream>
using namespace std;

int main()
{
	int i=6;
	while(i<=5)
	{
		cout<<"while loop"<<endl;
	    i++;
	}
	i=6;
	do{
		cout<<"do-while loop"<<endl;
		i++;
	}while(i<=5);
	
	return 0;
}