#include <stdio.h>
int main()
{
int i,j;
int n=1;
for(i=1; i<=4; i++)
{
for(j=1; j<=i; j++)
{
printf("%3d",n);
n++;
}
printf("\n");
}
return 0;
}
#include <iostream.h>
int main()
{
int i,j;
int n=1;
for(int i =1; i<=4; i++)
{
for(int j =1; j<=i; j++)
{
cout<<n;
n++;
}
cout<<endl;
}
return 0;
}
class PatternProg
{
public static void main(String a[])
{
int i;
int j;
int n = 1;
for (i = 1; i <= 4; i++)
{
for (j = 1; j <= i; j++)
{
System.out.print(n);
n++;
}
System.out.print("\n");
}
}
}
using System;
class PatternProg
{
public static void Main(string[] a)
{
int i;
int j;
int n = 1;
for (i = 1; i <= 4; i++)
{
for (j = 1; j <= i; j++)
{
Console.Write(n);
n++;
}
Console.WriteLine();
}
Console.ReadKey(true);
}
}
num = 1
for x in range(1, 5):
for y in range(1, x + 1):
print(str(num) + " ", end="")
num += 1
print()