Tuesday, October 21, 2014

Print Y patterns with C Language





                                                              

#include<stdio.h>
#include<conio.h>

void main()
{
                        int i,n,j;
                        printf("\t enter value of n=");
                        scanf("%d",&n);
                        printf("\n\n");
                        for(i=0;i<n;i++)
                        {
                                    for(j=0;j<n;j++)
                                    {
                                                 if(i<=n/2&&(i==j||i+j==n-1)||(i>n/2&&j==n/2))
                                                 {
                                                              printf("*");
                                                 }
                                                 else
                                                 {
                                                              printf(" ");
                                                 }
                                    }
                                     printf("\n");
              }
}

6 comments:

  1. Looking for the Genuine Experience Certificate with 100% Complete Verification So Contact Experienced Letter Solutions Consulting Firms Which Provide Experienced Letter with100 % Guaranteed. Contact Now- 9599119376. Or Visit Website- https://experincedletter.blogspot.com/

    ReplyDelete
  2. Looking for the Genuine Experience Certificate with 100% Complete Verification So Contact Experienced Letter Solutions Consulting Firms Which Provide Experienced Letter with100 % Guaranteed. Contact Now- 9599119376. Or Visit Website- https://experincedletter.blogspot.com/

    ReplyDelete
  3. Your info is really amazing with impressive content..Excellent blog with informative concept. Really I feel happy to see this useful blog, Thanks for sharing such a nice blog..
    Android Training Institute in Chennai | Android Training Institute in anna nagar | Android Training Institute in omr | Android Training Institute in porur | Android Training Institute in tambaram | Android Training Institute in velachery

    ReplyDelete
  4. Great Article Cloud Computing Projects

    Networking Projects

    Final Year Projects for CSE

    JavaScript Training in Chennai

    JavaScript Training in Chennai

    The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training

    ReplyDelete