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

Ripple as referred to in a rectifier circuit.

580


Explain the difference between microprocessor and micro controller?

543


Why thyristors are not preferred for inverters?

1128


4 Stage ripple counter with delay(f/f) 10msec. How much time it takes for a state to change. 4*10=40.

632


What is the difference between race and race around condition

1708






How is sio2 layer formed in a monolithic ic?

617


hi, This is manglam.I have done BE(E&TC). I have been selected for icici po interview on 7th sept.So what type of questions they may ask? If u have any interview questions , plz mail me(vickymanglam@gmail.com). are the gd topics always related with economics?

1870


WHAT IS DIFFERENCE BETWEEN. WRITE: a+m(2). m = m + 1. + OF THESE TWO IN SAP ABAP

1565


importance of defining tg or tf in selecting master and slave bts's?

1635


Define negative frequency?

553


Name the modulation techniques.

637


Explain the different modes of buck boost converter

590


What is the tri state of a signal?

557


how profibus transfer data?

586


what is a random variable?

3235