Posted by : Unknown Thursday, February 4, 2016



 
Ans:
#include <stdio.h>

int main()
{
    int i, j, n;

    printf("Enter value of n : ");
    scanf("%d", &n);

    for(i=n/2; i<=n; i+=2)
    {
        for(j=1; j<n-i; j+=2)
        {
            printf(" ");
        }

        for(j=1; j<=i; j++)
        {
            printf("*");
        }

        for(j=1; j<=n-i; j++)
        {
            printf(" ");
        }

        for(j=1; j<=i; j++)
        {
            printf("*");
        }

        printf("\n");
    }

    for(i=n; i>=1; i--)
    {
        for(j=i; j<n; j++)
        {
            printf(" ");
        }

        for(j=1; j<=(i*2)-1; j++)
        {
            printf("*");
        }

        printf("\n");
    }

    return 0;
}


 **********OUTPUT********** 
Enter value of n : 10

  *************************

Leave a Reply

Thanks for your comment

Subscribe to Posts | Subscribe to Comments

Welcome to My Blog

Popular Post

Blogger templates

Powered by Blogger.

Author Info

Blogroll

Blogroll

Slider[Style1]

Image Documents

View more

Popular Posts

Total Pageviews

Blog Archive

Blog Archive

Komentar

Artikel Terbaru

About me

Facebook

Advertise

Recent Posts

Search This Blog

Recent Posts

Sponsor

Video Of Day

Text Widget

Sample Text

Contact Us

Name

Email *

Message *

Followers

Labels

Site Links

Join the Team

Social Icons

Find Us On Facebook

Flickr Images

Social Media

Pages

Join with us

Popular Posts

Legal Documents

View more

Popular Posts

Getting Started

View more

- Copyright © SmileBD -Robotic Notes- Powered by Blogger - Designed by Johanes Djogan -