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
What is a struct c#?
Explain the binary height balanced tree?
Why c is called a mid level programming language?
Write a program to find the biggest number of three numbers in c?
Can you please explain the difference between exit() and _exit() function?
Why is c known as a mother language?
Explain void pointer?
What is sorting in c plus plus?
What is a volatile keyword in c?
What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?
Can main () be called recursively?
#define f(g,h) g##h main O int i=0 int var=100 ; print f ("%d"f(var,10));} wat would be the output??
When should the volatile modifier be used?
what will be the output for the following main() { printf("hi" "hello"); }
What functions are used for dynamic memory allocation in c language?