Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

SIR PLS TELL ME THE CODE IN C LANGUAGE TO PRINT THE
FOLLOWING SERIES
1
1 2 1
1 2 3 2 1
1 2 3 4 3 2 1
1 2 3 2 1
1 2 1
1

Answer Posted / sakthivel

/*
Written By : Sakthivel
Tested By : Rajavelraj
*/




#include<stdio.h>
#include<conio.h>

public void main()
{

int i,j,k,l,a=1;

for(i=1;i<=4;i++)
{
for(j=4;j>i;j--)
{
printf(" ");
}

for(k=1;k<=i;k++)
{
printf("%d",k);
}

for(l=i;l>1;l--)
{
printf("%d",l-1);
}

printf("\n");
}

for(i=4;i>1;i--)
{
for(j=1;j<=a;j++)
{
printf(" ");
}

for(k=1;k<i;k++)
{
printf("%d",k);
}

for(l=k-1;i>1;l--)
{
printf("%d",l-1);
}
a=a+1;
printf("\n");
}
getch();
}

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I read the arrow keys? What about function keys?

1096


Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.

1983


Explain zero based addressing.

1047


What does 3 periods mean in texting?

1081


How do we open a binary file in Read/Write mode in C?

1248


What is the purpose of scanf() and printf() functions?

1252


Who is the founder of c language?

1179


Explain how can a program be made to print the line number where an error occurs?

1229


What is %g in c?

1087


simple program of graphics and their output display

2011


Is c is a procedural language?

1107


How is a structure member accessed?

1146


Explain what does it mean when a pointer is used in an if statement?

1077


What is %lu in c?

1274


What do you understand by normalization of pointers?

1070