1
1 2
1 2 3
1 2 3 4
1 2 3 4 5

how to print this using while statement??



1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 how to print this using while statement??..

Answer / divyesh

int i=1,j,k;
while(i<6)
{
k=((10-(2*i)))/2;
while(k>0)
{
printf(" ");
k--;
}
j=1;
while(j<=i)
{
printf("%d ",j);
j++;
}
printf("\n");
i++;
}

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Engineering AllOther Interview Questions

What are tasks?

1 Answers  


what is the quantity of cement and sand in 1 sq.m (mortar ratio ) a, 1:4 b, 1:3 c, 1:6

0 Answers  


Find the maximum stress intensity in the section?

0 Answers  


What is smoke testing?

1 Answers  


A rectangular plank (2)1/2 meters wide can be placed so that it is on either side of the diagonal of a square shown below.(Figure is not available) What is the area of the plank?

1 Answers   Google, Mu Sigma,






where is interrupt vector table is located??

1 Answers   Infosys,


is the density of water decreases if we go deep into the ocean?

1 Answers  


what is isolator

0 Answers  


hey frnds..i have taken an emergency interview date of 21st july and my school is starting from 8th sept...i was continuously checking the date from 10 days but was not able to get a normal date...so can i get a rejection on this, that i have taken an emergency date.??????

0 Answers  


is the meter head is same as back pressure?

0 Answers   GDex,


Hi my dears I have 2 questions. 1- how many types of test are there at all? 2- how can I define test characteristics (such as test duration and parameter severity)in developing a modern technological equipment? I tanks you for introducing or sending a text handbook or guidebook file for me. thanks for your coming answers. yours sincerely

0 Answers  


what is static identifier in c language?

0 Answers  


Categories
  • Civil Engineering Interview Questions Civil Engineering (5085)
  • Mechanical Engineering Interview Questions Mechanical Engineering (4451)
  • Electrical Engineering Interview Questions Electrical Engineering (16632)
  • Electronics Communications Interview Questions Electronics Communications (3918)
  • Chemical Engineering Interview Questions Chemical Engineering (1095)
  • 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)