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



how do i write program like one shown 1234567654321 123456 654321 12345 54321 1234 4321 ..

Answer / ayshu

it can be done using nested for loop

Is This Answer Correct ?    20 Yes 3 No

how do i write program like one shown 1234567654321 123456 654321 12345 54321 1234 4321 ..

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

how do i write program like one shown 1234567654321 123456 654321 12345 54321 1234 4321 ..

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

how do i write program like one shown 1234567654321 123456 654321 12345 54321 1234 4321 ..

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

Post New Answer

More Electronics Communications Interview Questions

Draw the interface diagram of two microcontrollers?

1 Answers   L&T,


Explain the different modes of buck boost converter

0 Answers  


what is the basic difference between latches and flip flops

5 Answers   ABC,


Define interfacing?

0 Answers  


Explain the main application of scr in electronic field as well as in software field?

0 Answers  






what is the difference between pthread and taskSpawn

0 Answers  


which is preferred in ckts for x-or operation a) 1 x-or gate b) 4 nand gates

1 Answers  


Write the definition of the duality theorem?

0 Answers  


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.

2 Answers  


What do you mean by EDGE and any link for possible interview questions on this topic?

4 Answers  


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?

0 Answers  


Categories
  • Civil Engineering Interview Questions Civil Engineering (5084)
  • Mechanical Engineering Interview Questions Mechanical Engineering (4451)
  • Electrical Engineering Interview Questions Electrical Engineering (16631)
  • Electronics Communications Interview Questions Electronics Communications (3918)
  • Chemical Engineering Interview Questions Chemical Engineering (1094)
  • Aeronautical Engineering Interview Questions Aeronautical Engineering (239)
  • Bio Engineering Interview Questions Bio Engineering (96)
  • Metallurgy Interview Questions Metallurgy (361)
  • Industrial Engineering Interview Questions Industrial Engineering (259)
  • Instrumentation Interview Questions Instrumentation (3014)
  • Automobile Engineering Interview Questions Automobile Engineering (332)
  • Mechatronics Engineering Interview Questions Mechatronics Engineering (97)
  • Marine Engineering Interview Questions Marine Engineering (124)
  • Power Plant Engineering Interview Questions Power Plant Engineering (172)
  • Textile Engineering Interview Questions Textile Engineering (575)
  • Production Engineering Interview Questions Production Engineering (25)
  • Satellite Systems Engineering Interview Questions Satellite Systems Engineering (106)
  • Engineering AllOther Interview Questions Engineering AllOther (1379)