write a program to display the numbers in the following
format
4 4
3 3 3 3
2 2 2 2 2 2
1 1 1 1 1 1 1 1
0 0 0 0 0 0 0 0 0
1 1 1 1 1 1 1
2 2 2 2 2
3 3 3
4
Answer Posted / bharath_471
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k,l,n;
clrscr();
printf("enter the number");
scanf("%d",&n);
for(j=n,l=1;(j>0 && l<=n);j--,l++)
{
for(k=1;k<=2*l;k++)
printf("%d",j);
printf("
");
}
for(j=0,l=n;(j<=n && l>=0) ;j++,l--)
{
for(k=1;k<=2*l+1;k++)
printf("%d",j);
printf("
");
}
getch();
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Tell us two differences between new () and malloc ()?
In c programming write a program that will print 10 multiples of 3 except 15,18,21 using looping
What is c programing language?
Why double pointer is used in c?
Can static variables be declared in a header file?
can any one please explain, how can i access hard disk(physical address)? it is possible by the use of far,near or huge pointer? if yes then please explain......
What is scope of variable in c?
What is a pointer variable in c language?
Is there a built-in function in C that can be used for sorting data?
Explain what is the most efficient way to store flag values?
How can I direct output to the printer?
Describe the header file and its usage in c programming?
What is zero based addressing?
Sir,please help me out with the code of this question. Write an interactive C program that will encode or decode multiple lines of text. Store the encoded text within a data file, so that it can be retrieved and decoded at any time. The program should include the following features: (a) Enter text from the keyboard, encode the text and store the encoded text in a data file. (b) Retrieve the encoded text and display it in its encoded form. (c) Retrieve the encoded text, decode it and then display the decoded text. (d) End the computation. Test the program using several lines of text of your choice.
Is c procedural or object oriented?