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 / vignesh1988i

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

Is This Answer Correct ?    11 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of #define preprocessor in c?

1081


How many loops are there in c?

1115


How to write a multi-statement macro?

1050


Why is c fast?

1070


What is the right type to use for boolean values in c? Is there a standard type? Should I use #defines or enums for the true and false values?

1061


What is malloc return c?

1033


Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.

2096


What are volatile variables in c?

953


Function which gives a pointer to a binary trees const an integer value at each code, return function of all the nodes in binary tree.?

1079


How many types of arrays are there in c?

1049


difference between native and cross compilers

2135


What are pragmas and what are they good for?

1001


Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?

1088


code for quick sort?

2042


#define MAX(x,y) (x) >(y)?(x):(y) main() { inti=10,j=5,k=0; k= MAX(i++,++j); printf("%d..%d..%d",i,j,k); }

1160