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
can anyone please tell about the nested interrupts?
a direct address that identifies a location by means of its displacement from a base address or segment a) absolute address b) relative address c) relative mode d) absolute mode
How can you read a directory in a C program?
What are the application of c?
What are the advantages of the functions?
How can variables be characterized?
Why do we use & in c?
I need testPalindrome and removeSpace
#include
What does the error message "DGROUP exceeds 64K" mean?
Why is it important to memset a variable, immediately after allocating memory to it ?
Why we use stdio h in c?
What is struct node in c?
Tell me when would you use a pointer to a function?
what is a NULL Pointer? Whether it is same as an uninitialized pointer?
Define C in your own Language.