how do i write program like one shown
1234567654321
123456 654321
12345 54321
1234 4321
123 321
12 21
1 1
Answers were Sorted based on User's Feedback
Answer / swathi
we have to use nested for loops and also some predefined
functions which makes the cursor to jump to new location or
else \n,]b can be used in c pragram
Is This Answer Correct ? | 8 Yes | 3 No |
Answer / 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 |
Answer / 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 |
what is electronics
9 Answers Google, L&T, Rocket Media,
light travels faster than sound then why do we hear sound first and not video in telivision?
Describe transducer ei pickups in instrumentation and control engineering?
with the aid of diagrams explain pulse modulation,pulse position modulation and pulse amplitude modulation
1 Answers Value Labs, Zimbabwe Broadcasting Corporation ZBC,
Q.1what is E1? Q.2what is diffrence b/w RNC & BSC? Q.3what is STM? Q.4what is LAC & CI? Q.5 what is HSN, MAIO, MA Group & frequency hopping?
Y did u select he engineering?
HOW CAN I WRITE the SCENARIO , USE CASE , Hierarchical Task Analysis AND PLAN FOR ATM ? URGENT
Why crystal oscillator at 11.59MHz is used in Interactive voice responce circuit.
Is a hole a fundamental particle in an atom?
Draw the circuit of ce configurations using npn transistor.
What happens when an inverter is placed between both inputs of s-k flip flop?
in what condition transistor act as switch and amplifier?