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 the use of #define preprocessor in c?
How many loops are there in c?
How to write a multi-statement macro?
Why is c fast?
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?
What is malloc return c?
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.
What are volatile variables in c?
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.?
How many types of arrays are there in c?
difference between native and cross compilers
What are pragmas and what are they good for?
Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?
code for quick sort?
#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); }