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

Answer Posted / amit

#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-1;j++)
printf(" ");
for(j=n-i;j>0;j--)
printf("%d",j);

printf("\n");
}
}

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many GDA exists for a group ?

3804


define why diodes are not operated in the breakdown region in rectifiers?

672


What is an instrumentation amplifier?

606


What are the popular ic packages available?

725


What is Interleaving? Why do we need it?

2159






Why cc configuration is called a voltage buffer? Define what is other name?

693


What are potential transformers?

577


What is monotonic dac?

633


Fr aptitude question which for preparing good book?

1536


What is a bcd? What are its advantages and disadvantages? Why is an excess-3 code is called an unweighted code?

546


A PLL maintains lock by comparing A The phase of two signals B The frequency of two signals C The amplitude of two signals D None of these

1801


What do you mean by donor and acceptor impurities?

623


Tell me what are the components has to be done in fpga board (altera)?

525


plz help how can i operate my n/w support system through ,help me by providing complete soln

1405


Explain how to increase the gain and directivity of an antenna?

564