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...

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


Please Help Members By Posting Answers For Below Questions

How do you search data in a data file using random access method?

1252


What is difference between structure and union in c?

923


Difference between exit() and _exit() function?

1075


What is a pointer on a pointer in c programming language?

1091


What is uint8 in c?

1053


List the difference between a While & Do While loops?

1051


Explain how to reverse singly link list.

1071


Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.

2038


What is a c token and types of c tokens?

1010


What are formal parameters?

1067


What is static identifier?

1164


Where is c used?

1033


What is c method?

940


void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }

1666


Here is a good puzzle: how do you write a program which produces its own source code as output?

1034