C program to print a numerical (number) pattern - My CS Tutorial - My CS Tutorial

Breaking

Programming languages full tutorial and programs, exam papers, visual basic( Vb.net ), information of new technologies and more....

Wednesday, December 25, 2019

C program to print a numerical (number) pattern - My CS Tutorial

C program to print a numerical pattern.
In this tutorial we will learn how to write a c program code to print or create a numerical pattern that print rows of numbers.

Example-:



C program code


#include<stdio.h>
#include<conio.h>
void main()
{
 int num,a,b;
 clrscr();
 printf("\n Enter number or range of rows:\n ");
 scanf("%d",&num);
  printf("\n");
 for(a=1;a<=num;a++)
 {

  for(b=1;b<=num;b++)
  {
   printf(" %d ",a);

  }

 printf("\n");
 }
 getch();
}


OUTPUT:





In this output we can see that it is a numerical pattern.
In the first we will enter the range of rows then pattern will be print.
In this output the range of rows is 9 and the column and rows both are equal as 9.


Please share this post and blog link with your friends.For more programs use this blog.
If you have any problem, please comment in comment box, subscribe this blog for notifications of new post on your email and follow this blog.If you have any method of this program or want to give any suggestion send email on hc78326@gmail.com

Created by-- HARSH CHAUHAN

No comments:

Post a Comment