New Text Document

You might also like

You are on page 1of 1

// Online C compiler to run C program online

#include <stdio.h>

int main() {
// Write C code here
int n = 5;
int l = 2*(n-1);

for(int i =1; i<=n; i++)


{
int t = 1;
for(int j = 1; j<= l;j++)
{
if(i == j)
{
printf("%d\n",t);
t++;
}
// if((j-i) < i)
// {
// t--;
// printf("%d\t",t);
// }
if(i > j)
{
printf("%d\t",t);
t++;
}
if(i<=j)
{
t--;
printf(" ");
}

}
printf("\n");
}

return 0;
}

You might also like