Sunday 1 November 2015

Write a program to print the following pattern using loop in c language.

Write a program to print the following pattern using loop in  c language. #include<studio.h> #include<coino.h> Void... thumbnail 1 summary

Write a program to print the following pattern using loop in  c language.


#include<studio.h>
#include<coino.h>
Void main()
{
            Int I,j,n,k,l=1;
            Printf(“Enter Your no : ”);
            Scanf(“%d”,&n);
            For(i=1;i<=n;i++)
            {
                        For(j=n;j>I;j--)
                        {
                                    Printf(“  “);
                        }
                        For(k=1;k<=I;k++)
                        {
                                    Printf(“%d”,l);
                                    Printf(“  “);
                                    l++;
            }
Printf(“\n”);
             }
}


Output :- 

                                                          1      
                                                2                 3      
                                      4                 5                 6

                             7                 8                 9                 10

No comments

Post a Comment