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 can i make a program with this kind of output..

Enter a number: 5
0
01
012
0123
01234
012345
01234
0123
012
01
0

Answer Posted / manoj

#include <stdio.h>
int main ()
{
/*declaration*/
int n = 5 ;
int i, j;

/*clean screen*/
clrscr();

/*actual functionality*/
for( i =0; i<=n; i++)
{
printf("\n");
for(j=0; j<=i; j++)
printf("%d",j);
}

for( i =4; i<n&&i>=0; i--)
{
printf("\n");
for(j=0; j<=i; j++)
printf("%d",j);

}

/*return to TC*/
getch();

return 0;
}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is void a keyword in c?

972


What is wild pointer in c?

1054


How can I delete a file?

1051


what is bit rate & baud rate? plz give wave forms

1960


I came across some code that puts a (void) cast before each call to printf. Why?

1198


Explain what header files do I need in order to define the standard library functions I use?

1157


Explain what will the preprocessor do for a program?

1048


Multiply an Integer Number by 2 Without Using Multiplication Operator

747


What is meant by inheritance?

1068


What is scanf () in c?

1105


In C programming, how do you insert quote characters (‘ and “) into the output screen?

1510


How do you define a string?

1083


write a program that types this pattern: 12345678987654321 12345678 87654321 1234567 7654321 123456 654321 12345 54321 1234 4321 123 321 12 21 1 1

3919


Differentiate between full, complete & perfect binary trees.

1081


What is line in c preprocessor?

1036