ad

Saturday, March 22, 2025

C Program to Print Pascal's Triangle

C Program

C Program to Print Pascal's Triangle

C Program to Print Pascal's Triangle 

Example 

#include<stdio.h>

int main()

{

    int  row,coef=1,space,i,j;

    printf("enter the number");

    scanf("%d",&row);

    for (i=0;i<row;i++)

    {
    for(space=1;space<=row -i;space++)

    printf(" ");

    for(j=0;j<=i;j++)

    {

    if(j==0||i==0)

    coef =1;

    else

    coef=coef * (i-j+1)/j;

printf("%4d",coef);

    }

    printf("\n");

    }

return 0;

}


C Program to Print Pascal's Triangle 

 Program Output :- 



Related Post :-


C program number pattern

Friday, March 21, 2025

C Program to Print Full Pyramid of star pattern

C Program 

C Program  to Print Full Pyramid of star pattern

C Program  to Print Full Pyramid of star pattern

Example 

#include<stdio.h>
void main ()
{
int i,space,r,k=0;
   
printf("enter the number");
scanf("%d",&r);
for(i=1;i<=r;i++,k=0)
{
for(space=1;space<=r-i;space++)
{
printf(" ");
}
while(k !=2*i-1){
printf("*");
++k;
}
printf("\n");
}
return 0;
}


C Program  to Print Full Pyramid of star pattern

 Program Output :- 

C Program  to Print Full Pyramid of star pattern




Related Post :-

free online learn C programming-course

C Program print Inverted Right Half Pyramid Star Pattern

Thursday, March 20, 2025

C Program to Print Inverted half Pyramid of Number


C Program to Print Inverted half Pyramid  of Number

C Program to Print Inverted half Pyramid  of Number

Example 

#include<stdio.h>
void main ()
{
int i,j,r;

printf("enter the number");
scanf("%d",&r);
for(i=r;i>=1;i--)
{
for(  j=1;j<=i;j++)
{
printf("%d",j);
}
printf("\n");
}
return 0;
}


C Program to Print Inverted half Pyramid  of Number

 Program Output :- 


C Program to Print Inverted half Pyramids  of Number


Related Post :-

C Program Print Right Half Character Pyramid Pattern

C program print square star pattern


Wednesday, March 19, 2025

Write C Program to Print Inverted Half Pyramid of Stars Pattern

 

Write C Program to Print  Inverted Half Pyramid of Stars  Pattern


Write C Program to Print  Inverted Half Pyramid of Stars  Pattern

Example 

#include<stdio.h>
void main ()
{
int i,j,r;
printf("enter the number");

scanf("%d",&r);

for(i=r;i>=1;i--)

{
for(j=1;j<=i;j++)

{

printf("*");

}

printf("\n");

}

return 0;

}


Write C Program to Print  Inverted Half Pyramid of Stars  Pattern

 Program Output :- 

Write C Program to Print  Inverted Half Pyramid of Stars  Pattern


Related Post :-

number pattern program C

C program print square star pattern

Free online learn C programming course

Tuesday, March 18, 2025

Write C Program to Print Half Pyramid of Number Pyramid Pattern



Number Pattern Program in C


Number Pattern Program in C

Example 


#include<stdio.h>
void main ()
{
int i,j,r;
printf("enter the number");
scanf("%d",&r);
for(i=1;i<=r;i++)
{
for(j=1;j<=i;j++)
{
printf("%d",j);
}
printf("\n");
}
return 0;
}

Number Pattern Program in C

 Program Output :- 



Number Pattern Program in C


Related Post :-

C Program Print Right Half Number Pyramid Pattern

C Program Print Righ Half Character Pyramid Pattern

c program print square star pattern

Saturday, March 15, 2025

Write C Program to Print Right Half Number Pyramid Pattern

Write C Program to Print  Right Half number Pyramid  Pattern

 Write C Program to Print  Right Half Number  Pyramid  Pattern 

Example 

#include<stdio.h>

int main() {
int i,j ,row;
printf("enter the number of row");
scanf("%d",&row);
for(i=1; i<=row; i++)
  {
  for(j=1;j<=i;j++)

{
printf("%d",i);
}
printf("\n");
 }
getch();
}

 Write C Program to Print  Right Half Number  Pyramid  Pattern 

 Program Output :- 

Write C Program to Print  Right Half Right  Pyramid  Pattern

Related Post :-

HTML Multiple quetion MCQ

 C program print Right Half Pyramid Pattern

Friday, March 14, 2025

Write C Program to Print Right Half Character Pyramid Pattern

Write C Program to Print  Right Half Character Pyramid  Pattern

 Write C Program to Print Half Character Pyramid  Pattern 

Example 

#include<stdio.h>
int main ()

{

int i,j,n;
 printf("enter the no of line");
 
scanf("%d",&n);
 
for(i=1;i<=n;i++)
  {
 
for(j=1;j<=i;j++)
  {
 
printf("%c",(char)(i+64));
  }
 
printf("\n");
  }
   
getch();  

}

Write C Program to Print  Right Half Character Pyramid  Pattern  

 Program Output :-  Run 1 Time 

Write C Program to Print  Right Half Character Pyramid  Pattern

Related Post :-

C Program Print Square Star Pattern

 How  To Print Square Star Pattern in c

C Program  Print  Square Star Pattern

 How  To Print Square Star Pattern in c

Example 

#include<stdio.h>
int main()
{
int row,j,nacr();
for(row=1;row<=10 ;row++)
{
for(j=1;j<=15;j++)
{
printf("*");
}
printf("\n");
}
getch();
}

 How  To Print Square Star Pattern in c

 Program Output :-

C Program  Print  Square Star Pattern

Tuesday, March 11, 2025

C Program print Inverted Right Half Pyramid Star Pattern

C Program print Inverted Right Half Pyramid  Star Pattern

Example :- 

//inverted half pyramidoc c language


#include<stdio.h>
int main()
{
int i,j,row;
printf
("enter number row");
scanf("%d",&row);
for(i=row;i>=1;i--)
{
for
(j=1;j<=i;j++)
{
printf
("*");
}
printf
("\n");
}
getch
();
}

C Program print Inverted Right Half Pyramid  Star Pattern

Program Output ;-  Run 1 Time


C Program print Inverted Right Half Pyramid  Star Pattern

Program Output ;-  Run 2 Time





Related Post :-


Monday, March 10, 2025

C Program Print Inverted Pyramid

C Program Print Inverted Pyramid

C Program Print Inverted Pyramid

Example 


#include<stdio.h>
int main()
{

int i,j,row;
printf("enter number row");
scanf("%d",&row);
for(i=row;i>=1;i--)
{

for(j=1;j<=i;j++)
{
printf("*");
}
printf("\n");
}
getch ();
}






C Program Print Inverted Pyramid

 Program Output ;-  Run 1 Time 

C Program Print Inverted Pyramid

C Program Print Inverted Pyramid

 Program Output ;-  Run 2 Time



C Program Print Inverted Pyramid

Related Post :-

Website about us page html and css


Sunday, March 9, 2025

C Program To Print Swastik Pattern


C Program To Print Swastik Pattern

C Program To Print Swastik Pattern

Example 

#include<stdio.h>
int main()
{
     
int a,b,n;
     
printf("Enter Swastik Size(n):");

     scanf("%d",&n);

     printf("* ");
   
     
for(a=0; a<n-2; a++)

           printf("  ");
   
     
for(a=0; a<n; a++)  
           
printf("* ");
   
     
printf("\n");
   
     
for(b=0; b<n-2; b++)
     {
           
printf("* ");
           
for(a=0; a<n-2; a++)
               
printf("  ");
           
printf("* \n");
     }
   
     
for(a=0; a<n*2-1; a++)    
           
printf("* ");
     
printf("\n");
   
     
for(b=0; b<n-2; b++)
     {
           
for(a=0; a<=n-2; a++)
               
printf("  ");

           printf("* ");

           for(a=0; a<n-2; a++)

                printf("  ");

           printf("* \n");
     }

     for(a=0; a<n; a++)  

           printf("* ");

     for(a=0; a<n-2; a++)

           printf("  ");

     printf("* ");  

     return 0;
}

C Program To Print Swastik Pattern

 Program Output ;-  Run 1 Time 


Enter Swastik Size (n) :5

 Program Output ;-  Run 2 Time 


     *                               *     *     *     *      *                    

     *                               *

     *                               *

     *                               *

      *      *      *      *      *     *      *      *       *

                                      *                              *

                                      *                              *

                                      *                              *

       *    *     *       *      *                               *


Related Post :-



triangle patterns in php program

Friday, March 7, 2025

Write C Program To Print Multiplication Table using For Loop

C Program 

Write  C Program  To Print  Multiplication Table  using For Loop

Q1 .] Write  C Program  To Print  Multiplication Table  using For Loop

Examples :-    

#include<stdio.h>
#include<conio.h>
void main()
{
int n,i;
clrscr();
printf("Enter Any Number:");
scanf("%d",&n);
for(i=1;i<=10;i++)
printf("%d\t",i*n);
getch();
}


Q1.] Write  C Program  To Print  Multiplication Table  using For Loop

 Program Output ;-  Run 1 Time 



Q1.] Write  C Program  To Print  Multiplication Table  using For Loop

 Program Output ;-  Run 2 Time 

Enter  Any  Number : 2
2  4  6  8  10  12 14 16 18  20


Related Post :-