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

Explain what are multibyte characters?

1194


What is pointer & why it is used?

1113


Why is #define used?

1275


In C language, a variable name cannot contain?

1276


what will be maximum number of comparisons when number of elements are given?

1906


What is the correct declaration of main?

1210


What is the use of the function in c?

1017


Is there a built-in function in C that can be used for sorting data?

1265


the process of defining something in terms of itself is called (or) in C it is possible for the functions to call themselves. A function called a) nested function b) void function c) recursive function d) indifinite function

1313


What is the auto keyword good for?

1149


What does == mean in texting?

1294


Differentiate call by value and call by reference?

965


What does typedef struct mean?

1108


An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above

1167


What are the functions to open and close the file in c language?

1041