For C/C++ , C# for while loop has the same layout.
while ( /*condition*/ )
{
// TO DO
}
for e.g:
int main()
{
int sum = 0, i = 0;
//While loop
while (i <= 100)
sum += i++;
printf("Sum %d", sum);
getchar();
return 0;
}
This code will sum from 0 to 100 ( Sigma from x = 0 to 100 of x)