Posted by : Unknown Wednesday, February 3, 2016

  
 
Ans:
#include <stdio.h>
int main()
{
    int i, j, n;
    //Reads the number of rows from user
    printf("Enter number of rows : ");
 
    scanf("%d", &n); 
 
    //Iterates over each row of pattern
    for(i=1; i<=n; i++)
    {
        //Prints trailing spaces
        for(j=i; j<n; j++)
        {
            printf(" ");
        } 
 
        //Prints the rhombus pattern
        for(j=1; j<=n; j++)
        {
            if(i==1 || j==1 || i==n || j==n)
            {
                printf("*");
            }
            else
            {
                printf(" ");
            }
        }
        printf("\n");
    }
    return 0;
}

 **********OUTPUT********** 
Enter number of rows : 5
 

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

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 -