C Programme to print asterisks | C languages

 Q. Write a program using one print statement to print the pattern of asterisks as sown below : 


A/.

====================================

 #include<stdio.h>

#include<conio.h>

void main()

{        clrscr();

int a,b,c;

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

{

for(c=1;c<a;c++)

{printf("*");

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

{

printf(" ");}

       }

printf("*\n");}

getch();}

====================================

Comments

Popular Posts