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

Which header file is used for clrscr?

569


What is the use of static variable in c?

587


What are the applications of c language?

615


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?

599


hi friends how r u as soon in satyam my interview is start but i m very confusued ta wat i do plz help me frndz wat can i do plz tell me some question and answers related with "C" which r asked in the interview .

1895






code for find determinent of amatrix

1508


What is a list in c?

610


What are keywords c?

594


Linked list is a Linear or non linear explain if linear how it working as a non linear data structures

1756


What is the main difference between calloc () and malloc ()?

566


can any one please explain, how can i access hard disk(physical address)? it is possible by the use of far,near or huge pointer? if yes then please explain......

1398


What are the 5 organizational structures?

557


What is the general form of #line preprocessor?

577


If the size of int data type is two bytes, what is the range of signed int data type?

581


What is line in c preprocessor?

606