i want the code for printing the output as follows
4 4
3 3
2 2
1 1
0
1 1
2 2
3 3
4 4
Answer Posted / vignesh1988i
#include<stdio.h>
#include<conio.h>
void main()
{
int m,i,j;
printf("enter the max. number for the series :");
scanf("%d",&m);
for(i=m;i<=0;i--)
{
for(j=0;j<m-i;j++)
printf(" ");
printf("%d",i);
for(j=1;j<=(2*m-(m-i+1+(m-i)));j++)
printf(" ");
printf("%d",i);
printf("\n");
}
i++;
j=m-1;
for(;i<=m;i++)
{
for(;j>(m-i);j--)
printf(" ");
printf("%d",i);
for(j=1;j<(2*i);j++)
printf(" ");
printf("%d",i);
printf("\n");
}
getch();
}
thank u
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is difference between function overloading and operator overloading?
What does s c mean on snapchat?
Why are algorithms important in c program?
What is equivalent to ++i+++j?
How can you return multiple values from a function?
What are the types of type qualifiers in c?
What is s in c?
What is data structure in c programming?
List out few of the applications that make use of Multilinked Structures?
What does the characters “r” and “w” mean when writing programs that will make use of files?
Can we access the array using a pointer in c language?
Where are the auto variables stored?
Explain why C language is procedural?
how much salary u want ? why u join in our company? your domain is core sector why u prefer software ?
largest Of three Number using without if condition?