Search This Blog
Welcome to 1printf(), your ultimate destination for C, C++, Linux, Data Structures, and Microcontroller programming! 🚀 🔹Learn advanced coding techniques in C& C++ 🔹Master Linux internals & shell scripting 🔹Deep dive into Data Structures & Algorithms 🔹Explore Embedded Systems & Microcontrollers (8051,UART, RTOS) 🔹Get hands-on coding tutorials, project ideas,and interview preparation tips Whether you're a beginner or an experienced programmer, this channel will help you
Featured
- Get link
- X
- Other Apps
Left-Aligned Right-Angled Triangle Star Pattern in C
Pattern Name
Left-Aligned Right-Angled Triangle Star PatternOther acceptable names:
-
Increasing Star Triangle Pattern
-
Left-Aligned Triangle Pattern
-
Right-Angled Star Triangle
-
Half Pyramid Pattern using Stars
This is one of the most classic patterns for beginners in C programming
***********************************************
*
* *
* * *
* * * *
* * * * *
#include<stdio.h>
int main( )
{
int num,i,j;
printf("Enter the number:\n");
scanf("%d",&num);
for(i=1;i<=num;i++)
{
for(j=1;j<=i;j++)
{
printf("* ");
}
printf("\n");
}
}
***********************************************
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
#include<stdio.h>
int main( )
{
int num,i,j;
printf("Enter the number:\n");
scanf("%d",&num);
for(i=1;i<=num;i++)
{
for(j=1;j<=i;j++)
{
printf("%d ",i);
}
printf("\n");
}
}
***********************************************
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
#include<stdio.h>
int main( )
{
int num,i,j;
printf("Enter the number:\n");
scanf("%d",&num);
for(i=1;i<=num;i++)
{
for(j=1;j<=i;j++)
{
printf("%d ",j);
}
printf("\n");
}
}
***********************************************
A
B B
C C C
D D D D
E E E E E
#include<stdio.h>
int main( )
{
int num,i,j;
printf("Enter the number:\n");
scanf("%d",&num);
for(i=1;i<=num;i++)
{
for(j=1;j<=i;j++)
{
printf("%c ",i+64);
}
printf("\n");
}
}
***********************************************
A
A B
A B C
A B C D
A B C D E
#include<stdio.h>
int main( )
{
int num,i,j;
printf("Enter the number:\n");
scanf("%d",&num);
for(i=1;i<=num;i++)
{
for(j=1;j<=i;j++)
{
printf("%c ",j+64);
}
printf("\n");
}
}
***********************************************
Popular Posts
C++ Program for Hybrid Inheritance (All Types Together)
- Get link
- X
- Other Apps
C++ Program for Function Overloading Example
- Get link
- X
- Other Apps
Comments
Post a Comment