Problem : friends Help Me i want to print this type of pattern:
*
..*
....*
......*
........*
..........*
............*
..............*
.................*
#include<stdio.h>
#include<conio.h>
void main()
{
int i=0,no=0,j=0;
clrscr();
printf("\nPlease Enter The Number : - ");
scanf("%d",&no);
for(i=0;i<no;i++)
{
printf("\n");
for(j=0;j<no;j++)
{
if(i==j)
printf("*");
else
printf(" ");
}
}
getch();
}
*
..*
....*
......*
........*
..........*
............*
..............*
.................*
#include<stdio.h>
#include<conio.h>
void main()
{
int i=0,no=0,j=0;
clrscr();
printf("\nPlease Enter The Number : - ");
scanf("%d",&no);
for(i=0;i<no;i++)
{
printf("\n");
for(j=0;j<no;j++)
{
if(i==j)
printf("*");
else
printf(" ");
}
}
getch();
}
1 comments:
For more information about C practicals, visit
http://cprogrampracticals.blogspot.com
Post a Comment