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 ? | 1 Yes | 0 No |
Post New Answer View All Answers
What does %d do in c?
What are the Advantages of using macro
How do I swap bytes?
Tell me can the size of an array be declared at runtime?
What is 02d in c?
Explain the use of #pragma exit?
What do header files do?
Describe dynamic data structure in c programming language?
How can I generate floating-point random numbers?
main() { struct s1 { char *str; struct s1 *ptr; }; static struct s1 arr[] = { {"Hyderabad",arr+1}, {"Bangalore",arr+2}, {"Delhi",arr} }; struct s1 *p[3]; int i; < BR> for(i=0;i<=2;i++) p[i] = arr[i].ptr; printf("%s ",(*p)->str); printf("%s ",(++*p)->str); printf("%s ",((*p)++)->str); }
what are bit fields? What is the use of bit fields in a structure declaration?
Write a program to reverse a given number in c language?
What is the use of ?: Operator?
What is the ANSI C Standard?
How to write c functions that modify head pointer of a linked list?