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...

how to write a cprogram yo get output in the form
*
***
*****
*******
*********
*******
*****
***
*

Answer Posted / arka bandyopadhyay

#include<stdio.h>
#include<conio.h>
void main()
{ int i,j,k,a=4;

k=1;
clrscr();
printf("\n");
for(i=8;i>=0;i--)
{
for(j=0;j<=8 ;j++)


{
if(i>=4)
{
if(j<a ||j>(9-a-1) )
printf(" ");
else
printf(" *");



}
else
{
if(j>(8-k)||j< k)
printf(" ");
else
printf(" *");
}
}
--a;

if(i<4)k++;
printf("\n");
}


getch();
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the advantages and disadvantages of a heap?

1166


Is a pointer a kind of array?

1142


Do you know the difference between malloc() and calloc() function?

1026


What is storage class?

1026


How to write a program for machine which is connected with server for that server automatically wants to catch the time for user of that machine?

2067


What is difference between structure and union?

1096


How do I swap bytes?

1041


What is the importance of c in your views?

1127


#define f(g,h) g##h main O int i=0 int var=100 ; print f ("%d"f(var,10));} wat would be the output??

1927


State the difference between x3 and x[3].

1077


how do you programme Carrier Sense Multiple Access

1942


Do you know what are bitwise shift operators in c programming?

1078


write a program that reads lines(using getline), converts each line to an integer using atoi, and computes the average of all the numbers read. also compute the standard deviation.

2488


How can I call system when parameters (filenames, etc.) Of the executed command arent known until run time?

1046


Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.

1943