Interviews2 answers
Perfect Example Of While And Do-While Loop In C#.Net ?
2 Answers
while loop check first condition if it is satisfied then it will run further. Do-while loop initially skip first time condition check and start running but very second time it will check condition and start running.
Keshav ChauhanPosted Dec 26, 2016, 8:32 AM EST
sqlconnection con=new sqlconnection(@connectionstring);
int i=0;
while(connection is open)
{
i++;
}
it is increment and check condition.
int i=0;
do
{
i++;
}while(connection is open)
Maruthi PalllamalliPosted Dec 9, 2015, 4:40 AM EST

