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 |
Why are ics so cheap?
how PID work?
What are the different ways to check LED light/bulb?
explain Functional Descriptions D/240PCI-T1 and D/240SC-T1
what is difference between microprocessor and microcontroller ?
what kind of negative feedback is present in a noninverting op-amp.
Explain the modulation technique used in gsm.
How is the keycode calculated while interfacing a keyboard with a microprocessor?
why ammeter always connect in series for measuring the current?
What is transponder?
What is q-meter?
why job after btech without going to further education?