write a program to display the numbers in the following
4 4
3 3
2 2
1 1
0
1 1
2 2
3 3
4 4
Answer / vidyullatha
#include<stdio.h>
main()
{
int i,j,k,l;
int space=7;
for(i=4;i>=0;i--)
{
for(j=4;j>i;j--)
{
printf(" ");
}
printf("%d ",i);
for(j=0;j<space;j++)
{
printf(" ");
}
if(space>0)
printf("%d ",i);
space = space-2;
printf("\n");
}
space = 1;
for(i=1;i<=4;i++)
{
for(j=4;j>i;j--)
{
printf(" ");
}
printf("%d ",i);
for(j=0;j<space;j++)
{
printf(" ");
}
printf("%d ",i);
space = space+2;
printf("\n");
}
}
| Is This Answer Correct ? | 6 Yes | 0 No |
The file stdio.h, what does it contain?
Explain how can a program be made to print the name of a source file where an error occurs?
What is the purpose of & in scanf?
Write a C program to print 1 2 3 ... 100 without using loops?
main() { printf(5+"Vidyarthi Computers"); }
why Language C is plateform dependent
Write a C program that computes the value ex by using the formula ex =1+x/1!+x2/2!+x3+3!+………….
Why do we write return 0 in c?
find the output? void r(int a[],int c, int n) { if(c>n) { a[c]=a[c]+c; r(a,++c,n); r(a,++c,n); } } int main() { int i,a[5]={0}; r(a,0,5); for(i=0;i<5;i++) printf("\n %d",a[i]); getch(); }
What is NULL pointer?
who is the founder of c
19 Answers College School Exams Tests, HP,
What is file in c preprocessor?