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 |
print the pattern 1 2 4 3 6 9 4 8 12 16 5 10 15 20 25 if n=5
how to find out the union of two character arrays?
main() {int a=200*200/100; printf("%d",a); }
What are the advantage of c language?
What is the importance of c in your views?
Write a program to exchange two variaables without temp
What is property type c?
Explain what will be the outcome of the following conditional statement if the value of variable s is 10?
What functions are used in dynamic memory allocation in c?
What is difference between structure and union in c programming?
how to write a program which adds two numbers without using semicolon in c
Compare and contrast compilers from interpreters.