write a pgm to print
1
1 2 1
1 2 3 2 1
1 2 3 4 3 2 1
Answer Posted / nisrar
void main()
{
int i,j,k,m;
for(i=1;i<=4;i++)
{
for(j=4;j>i;j--)
{
printf(" ");
}
for(k=1;k<=i;k++)
{
printf("%d",k);
}
for(m=i;m>1;m--)
{
printf("%d",m-1);
}
printf("\n");
}
}
| Is This Answer Correct ? | 7 Yes | 0 No |
Post New Answer View All Answers
Are bit fields portable?
What is hungarian notation? Is it worthwhile?
Why is c not oop?
Is c++ based on c?
What are header files and explain what are its uses in c programming?
What is the difference between abs() and fabs() functions?
What is advantage of pointer in c?
What are the basic data types associated with c?
How do I get an accurate error status return from system on ms-dos?
Can one function call another?
How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?
What is a program?
What is structure and union in c?
What is an array in c?
How is = symbol different from == symbol in c programming?