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
why sometimes PF value have an negative sign?
what is the maximum delay gnerated by 555timer and why?
What are active & passive elements in BTS?
What is the approximate cost of the monitoring cables time domain reflectometry?
Why series inductor and l-section filters cannot be used with half-wave rectifiers?
what is meant by tunneling?
Explain the different modes of flyback converter
Can anyone send me question papers for section engineer for railways and send me on my id- abhay_jg@yahoo.com
For high voltage applications will you prefer mosfet or igbt?
What is inductor?
what is the difference between controller in mobile and processor in pc?
Why is schottky diode called hot-carrier diode?
What is a resistor?
Define what is the effect of temperature on the reverse current of a p-n junction?
what is resistive diode?