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
What is an lvalue?
How can I call fortran?
application attempts to perform an operation?
A SIMPLE PROGRAM OF GRAPHICS AND THEIR OUTPUT I WANT SEE WAHAT OUTOUT OF GRAPHICS PROGRAM
Why is it usually a bad idea to use gets()? Suggest a workaround.
What are the different types of pointers used in c language?
if (i = 0)printf ("True"); elseprintf("False"); Under what conditions will the above print out the string "True" a) Never b) Always c) When the value of i is 0 d) all of the above
What is the right type to use for boolean values in c?
What is the purpose of void in c?
What are different types of variables in c?
Are global variables static in c?
What is the method to save data in stack data structure type?
How does selection sort work in c?
Explain what are the different file extensions involved when programming in c?
What is register variable in c language?