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

Combinations of fibanocci prime series

1555


write a c program to print the next of a particular no without using the arithmetic operator or looping statements?

3839


What is union in c?

1059


What do you mean by invalid pointer arithmetic?

1001


How can you tell whether two strings are the same?

1202


#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }

1084


What is f'n in math?

1007


A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream

1115


What is an array in c?

999


What are data types in c language?

1008


What is a good data structure to use for storing lines of text?

1032


What is malloc return c?

973


The number of measuring units from an arbitarary starting point in a record,area,or control block to some other point a) recording pointer b) offset c) branching d) none

1183


void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }

1666


What are control structures? What are the different types?

1036