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 |
Draw the interface diagram of two microcontrollers?
Explain the different modes of buck boost converter
what is the basic difference between latches and flip flops
Define interfacing?
Explain the main application of scr in electronic field as well as in software field?
what is the difference between pthread and taskSpawn
which is preferred in ckts for x-or operation a) 1 x-or gate b) 4 nand gates
Write the definition of the duality theorem?
My present SMPS ( +12V, -12V outputs, 1Amp Rating ) was faulty.I donot have similar model however i have two + 12V SMPS available. Can i use both of these SMPS as a replacement to present SMPS by connecting one of SMPS in reverese polarity.
What do you mean by EDGE and any link for possible interview questions on this topic?
What are the different types of Channels in GSM and their Function
9 Answers NSN, Prithvi, Ratnakar Bank RBL,
Define what is meant by small signal amplifier?