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 do we need Interview?
what is VSWR?
what is that functionality of a relay? draw aconnection for relay?
14,25,49,169
Explain the differences between voltage and current controlled devices?
How can the race-around problem be solved?
What is tunnel diode?
What are the standards for the following :RS-23-C 802.3 X.25 802.11 ?
Write the total description of Ultra Commissioning.
dummy strain guage
Explain about diode in a brief manner..
What is meant by duty-cycle?
Civil Engineering (5086)
Mechanical Engineering (4456)
Electrical Engineering (16639)
Electronics Communications (3918)
Chemical Engineering (1095)
Aeronautical Engineering (239)
Bio Engineering (96)
Metallurgy (361)
Industrial Engineering (259)
Instrumentation (3014)
Automobile Engineering (332)
Mechatronics Engineering (97)
Marine Engineering (124)
Power Plant Engineering (172)
Textile Engineering (575)
Production Engineering (25)
Satellite Systems Engineering (106)
Engineering AllOther (1379)