Try to print the following number pattern using C++.
#include <iostream>
using namespace std;
int main()
{
int i, j, k;
for(i=1; i<=5; i++)
{
for(j=1; j<=5; j++)
{
if(j <= i)
cout << j;
else
cout << " ";
}
for(k=5; k>=1; k--)
{
if(k > i)
cout << " ";
else
cout << k;
}
cout << "\n";
}
return 0;
}