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?

1053


What does node * mean?

1146


Is main a keyword in c?

1086


Is c dynamically typed?

1093


What are the general description for loop statement and available loop types in c?

1076


What are the features of c language?

1025


Explain how do you view the path?

1092


What do you mean by scope of a variable in c?

974


How do you initialize pointer variables?

1034


How can I write a function that takes a format string and a variable number of arguments?

1005


write a program in c language to print your bio-data on the screen by using functions.

6735


Can you please explain the scope of static variables?

1000


What is a good way to implement complex numbers in c?

997


What is assignment operator?

1002


What is the difference between %d and %i?

1045