For Loop :
Coding:-
protected void Page_Load(object sender, EventArgs e)
{
for (int n = 1; n <= 10; n++)
{
Response.Write(n+"for loop<br>");
}
}
While Loop :
Coding :-
protected void Page_Load(object sender, EventArgs e)
{
int n = 1;
while (n <= 15)
{
Response.Write(n + "hello<br>");
n++;
}
}
No comments:
Post a Comment