Program to print number 4 in C Language without graphics

// Program to print number 4 in C language with CBhashaGyan

#include<stdio.h>

int main()

{

int i, j;

for (i=1; i<=5; i++)

{

    printf("\t");                //for horizontal tab

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

       if((j==1 && i<=3) || j==3 || i==3)

       printf("* ");      //for star with space

       else

       printf("  ");        //for double space

    }

   printf("\n");          //for new line

}

return 0;

}

Output:


*       *
*       *
*  *   *
        *
        *
         

Practical demonstration in Pictorial form-


Program to print number 4 in C Language without graphics
Program to print number 4 in C Language without graphics

Output:-

Program to print number 4 in C Language without graphics output
Program to print number 4 in C Language without graphics output

No comments:

Post a Comment