Pattern Printing coding 3


CODE NO:- 03

Print the below pattern

#Program (In C):
#include<stdio.h>
int main()
{
int n,i,j;
printf("\n enter the no.of rows:");
scanf("%d",&n);
for(i=0;i<n;i++)
{
        for(j=0;j<=i;j++)
  {
          printf("%d ",i+1);
        }
printf("\n");
}
return 0;
}

We got this output by using DEV C++ (IDE) 



Link: For other pattern printing problems

Comments

Post a Comment

Popular posts from this blog

WHY PROGRAMMING?

Series code 2

Pattern Printing coding 7