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

why sometimes PF value have an negative sign?

1601


what is the maximum delay gnerated by 555timer and why?

1919


What are active & passive elements in BTS?

1673


What is the approximate cost of the monitoring cables time domain reflectometry?

556


Why series inductor and l-section filters cannot be used with half-wave rectifiers?

617






what is meant by tunneling?

1771


Explain the different modes of flyback converter

554


Can anyone send me question papers for section engineer for railways and send me on my id- abhay_jg@yahoo.com

1635


For high voltage applications will you prefer mosfet or igbt?

678


What is inductor?

922


what is the difference between controller in mobile and processor in pc?

1504


Why is schottky diode called hot-carrier diode?

588


What is a resistor?

598


Define what is the effect of temperature on the reverse current of a p-n junction?

624


what is resistive diode?

1894