Q. WAP to generate following output:
*
**
***
****
*****
#BIT_FirstSem_2015_9No_8Marks_Solution
#include<stdio.h>
int main()
{
int i,j,space;
for ( i = 0; i < 5; i++)
{
for ( space = i; space <5; space++)
{
printf(" ");
}
for ( j = 0; j <= i; j++)
{
printf("*");
}
printf("\n");
}
return 0;
}
Output:
If you are using Turbo C++ IDE, then use conio.h in link section after stdio.h
and use getch(); to hold the output screen, just before the end of main function.
If you have any confusion regarding the program, please, comment below.
Happy Coding !
Thank you
Asterisk Pattern Printing in C
6:31 PM
asterisk pattern printing in c
,
C Programs
,
Nested Loop in C
,
OldQuestionSolution2015C
Edit
0 comments:
Post a Comment