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

What is engineering?

613


i am preparing for AAI JR EXECUTIVE exams so plz suggest the objective materail for preparation

2030


We have 6.6 KV, 250 KW HT Motor and i want to run this motor with 250 KW LT Variable frequency drive. Is this Possible? How? what are the major modification required?

1729


When do we need drive test?

1769


What is the importance of peak inverse voltage?

649






what is the importance of signals and systems ?

16368


What is schottky diode?

570


Explain the difference between dcs & plc & scada?

598


What is 74ls244?

571


What does the voltmeter in ac mode show?

600


i had cmpltd my diploma with 89% in ECE and i got call letter foe the interview of isro bengaluru which bks i hv ti prefer

1627


What is meant by small signal amplifier?

630


What are the different types of flip-flops?

578


Explain why normally control terminal of 555 timer is connected to ground through a 0.01µf bypass capacitor?

745


Explain the operating condition in scr.

588