jituTechnology

jituTechnology

Write the program to print following patterns

/*program to print numbers in the following  using loops.
Programmed by : kiran shrestha
Roll no. : 10121
Programmed on : 7th feb, 2011*/
#include <stdio.h>
#include <conio.h>
void main ()
{
     int i,j;
        for (i=1;i<=5;i++)
                {
                     for (j=1;j<=i;j++)
                           {
                                if(j%i!=0)
                                     printf (“%d\t”,0);
                                else
                                     printf (“%d\t”,1);
               }
                     printf (“\n”);
                }
   getch();
}
output
1
01
101
0101
10101

 

No comments yet.

Add a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.



Connect with Me

GPO 8973 NPC 541; Kathmandu Nepal
Phone: +977 9851236800

Calendar

May 2026
S M T W T F S
 12
3456789
10111213141516
17181920212223
24252627282930
31