#include<stdio.h>
#include<conio.h>
main()
{
int i,j,n; //variable declaration
printf("Enter number of lines to be used in pattern: "); //telling the user to enter number of rows
scanf("%d",&n);// taking in value from user
for(j=0;j<=n;j++) // tells number of rows
{
for(i=1;i<=j;i++) //decides number of stars in a row
{
printf("*");//printing pattern
}
printf("\n");//used for jumping into next row
}
getch();
}
Also see program to delete a node from a linklist
#include<conio.h>
main()
{
int i,j,n; //variable declaration
printf("Enter number of lines to be used in pattern: "); //telling the user to enter number of rows
scanf("%d",&n);// taking in value from user
for(j=0;j<=n;j++) // tells number of rows
{
for(i=1;i<=j;i++) //decides number of stars in a row
{
printf("*");//printing pattern
}
printf("\n");//used for jumping into next row
}
getch();
}
Also see program to delete a node from a linklist