C : Program to print 1 to 10 numbers in right half pyramid shape

--

Program :

//c program to print 1 to 10 numbers in right half pyramid shape 

#include<stdio.h>

int main()
{
int n=1;

for(int i=1; i<=4; i++)
{
for(int j=1; j<=i; j++)
{
printf("%3d", n);
n++;
}
printf("\n");
}

return 0;
}

Output :

--

--

Programmer Portfolio

Code enthusiast. Learning, practicing, and sharing my journey through various programming languages, one code at a time. 🚀💻