//Now let us see how the while loop works
using System;
using System;
namespace whileloop
{
class cl1
{
static void Main()
{
int i=0,j,sum=0;
Console.WriteLine("Enter 10 No.s");
while(i<10)
{
j=Convert.ToInt32(Console.ReadLine());
sum=sum+j;
i++;
}
Console.WriteLine("Sum="+sum);
}
}
}
No comments:
Post a Comment