how do i write program like one shown
1234567654321
123456 654321
12345 54321
1234 4321
123 321
12 21
1 1

Answer Posted / cinu

#include<stdio.h>
int main()
{
int i,j,n;
printf("Enter no");
scanf("%d",&n);
for(i=0;i<=n;i++)
{

for(j=1;j<=n-i;j++)
printf("%d",j);
for(j=0;j<2*i;j++)
printf(" ");
for(j=n-i;j>0;j--)
printf("%d",j);

printf("\n");
}
}

Is This Answer Correct ?    9 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to Create the Node file with 2 E1 (4+4+4) & EDAP.

1436


what is the use of FR-4(flame retardant)in PCB design why dielectric material used in inner layer in PCB design technology??

1520


What is meant by unidirectional or half-wave ac voltage controller?

577


How can a thyristor turned off?

697


What are the functions of base station system (bss)?

653






hi iam having b tech aggregate of 60%and 15 back locks cleared in course time and gre score of 1000 can i get visa

1320


What are the applications of precision diode.

582


What is the duty cycle in on-off control method?

596


What is the difference between xdm 100, 300, 1000, 2000

1229


what is difference between fiber otical cable and cat cable?

1522


what is an inverting amplifier?

595


What is the work of Bus cable, Power cable and Er cable in nokia flexi edge bts.

1265


Why vestigial side band is used in tv signal transmission?

506


What is memristor? How many modes it works? What is its advantage?

535


i have design dc-dc 3-way isolator circuit,how to test psrr,response time,limit frequency

1541