Tuesday, February 14, 2012

C++ program for pattern of numbers traingle

1
12
123
1234
12345


Code:-




#include "stdafx.h"
#include <iostream>
using namespace std;




int main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
cout<<j;
}
cout<<"\n";
}
return 0;
}

No comments:

Post a Comment