Pattern printing coding 1


CODE NO:- 01

Print the below pattern:

#Program (In C):
In  C language we use  ' // ' for single line comment

#include<stdio.h>//header file
int main()
{
int n,i,j;
printf("\n enter the no.of rows:");
scanf("%d",&n);
for(i=0;i<n;i++)//loop for no. of rows
{
        for(j=0;j<n;j++)//loop for no.of column
  {
printf("1 ");
        }// end of inner loop
printf("\n");
}// end of outer for loop
return 0;
}// end of main

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