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
Is void a keyword in c?
What is wild pointer in c?
How can I delete a file?
what is bit rate & baud rate? plz give wave forms
I came across some code that puts a (void) cast before each call to printf. Why?
Explain what header files do I need in order to define the standard library functions I use?
Explain what will the preprocessor do for a program?
Multiply an Integer Number by 2 Without Using Multiplication Operator
What is meant by inheritance?
What is scanf () in c?
In C programming, how do you insert quote characters (‘ and “) into the output screen?
How do you define a string?
write a program that types this pattern: 12345678987654321 12345678 87654321 1234567 7654321 123456 654321 12345 54321 1234 4321 123 321 12 21 1 1
Differentiate between full, complete & perfect binary trees.
What is line in c preprocessor?