Write a program that will display the following pattern using nested for loop
1
12
123
1234
12345
#include <iostream>
using namespace std;
int main()
{
for (int i=1;i<=5;i++)
{
for (int j=1;j<=i;j++)
cout << j;
cout <<endl;
}
return 0;
}
1
12
123
1234
12345
#include <iostream>
using namespace std;
int main()
{
for (int i=1;i<=5;i++)
{
for (int j=1;j<=i;j++)
cout << j;
cout <<endl;
}
return 0;
}
0 comments:
Post a Comment
Thanks For Your FeedBack....
Click to see the code!
To insert emoticon you must added at least one space before the code.