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

write a program to display the numbers in the following
format
4 4
3 3 3 3
2 2 2 2 2 2
1 1 1 1 1 1 1 1
0 0 0 0 0 0 0 0 0
1 1 1 1 1 1 1
2 2 2 2 2
3 3 3
4

Answer Posted / bharath_471

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k,l,n;
clrscr();
printf("enter the number");
scanf("%d",&n);
for(j=n,l=1;(j>0 && l<=n);j--,l++)
{
for(k=1;k<=2*l;k++)
printf("%d",j);
printf("
");
}
for(j=0,l=n;(j<=n && l>=0) ;j++,l--)
{
for(k=1;k<=2*l+1;k++)
printf("%d",j);
printf("
");
}
getch();
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you return multiple values from a function?

1068


how to make a scientific calculater ?

2026


What is chain pointer in c?

1016


How do you list a file’s date and time?

1036


Can a variable be both const and volatile?

1088


C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions

1012


what are non standard function in c

1864


Write a program to print fibonacci series using recursion?

1020


How many levels of pointers have?

1003


Can we change the value of #define in c?

969


What is the difference between new and malloc functions?

1065


What does s c mean in text?

1065


write a programe to accept any two number and check the following condition using goto state ment.if a>b,print a & find whether it is even or odd and then print.and a

1894


What are categories used for in c?

1045


int i=10; printf("%d %d %d", i, i=20, i);

1563