Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Write a program to give following output.....
*********
**** ****
*** ***
** **
* *
** **
*** ***
**** ****
*********

Answer Posted / vignesh1988i

sorry i have done a small mistake ..... this is correct

#include<stdio.h>
#include<conio.h>
void main()
{
int n,i,j,k;
printf("enter the no. of lines :");
scanf("%d",&n);
for(i=1;i<=(n*2-1);i++)
{
if(!(i^1)|| !(i^(n*2-1)))
{
for(j=1;j<=(n*2-1);j++)
printf("*");
}
else
{
if(i<=n)
{
for(j=1;j<=n-i;j++)
printf("*");
for(k=1;k<(2*(i-1));k++)
printf(" ");
for(j=n-i;j>=0;j--)
printf("*");
if(i==n)
{
k--;
m=k;
}
}
else
{
for(j=1;j<=(i-n+1);j++)
printf("*");
for(j=k;k<=k-n-1;k++)
printf(" ");
k-=2;
for(j=i-n+1;j>0;j--)
printf("*");
}
}
getch();
}

Is This Answer Correct ?    4 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is a house a shell structure?

1103


please help me..... please codes and flowchart plz turbo c lang po yan.....please asap response... 3. Make an astrology program. The user types in his or her birthday (month, day, and year as integer), and the program responds with the user’s zodiac sign, horoscope, and other information related to it. If the user’s birth year falls into a leap year, your program should display an appropriate message for it. NOTES: Conditional Statements: it should be with graphics

3270


Is there a way to have non-constant case labels (i.e. Ranges or arbitrary expressions)?

1015


What is the difference between malloc() and calloc()?

1683


In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none

1155


What are the 4 types of programming language?

1046


What is the use of void pointer and null pointer in c language?

1068


Can you please explain the scope of static variables?

996


What is volatile variable in c?

1050


How old is c programming language?

958


How was c created?

993


what is recursion in C

1018


What are the main characteristics of c language describe the structure of ac program?

1144


What is the explanation for the dangling pointer in c?

1059


What are pointers really good for, anyway?

1012