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

Explain what is meant by repetition of information and inability to represent information. Explain why each of these properties may indicate a bad relational database design.

1 Answers  


Why should we use white box testing

0 Answers  


what is D- channel ?

1 Answers   ZTE,


when did actually oil exploration start

0 Answers  


plz tell me which books r important for gate exam (CSE)

0 Answers  






a simple compiled code is run on a C compiler as well as java virtual machine. which runs faster and y?

3 Answers   Exilant,


Name some band definitions?

1 Answers  


Prepare the UGC CSIR net question papers those are enough. The question paper will be of 50 questions in size each 3 marks and with a negative of -1 for each wrong answer

0 Answers   Ecil,


What is the allowable load carrying capacity of a circular column section of 400 mm diameter reinforced with 6x25 mm diameter bars adequately tied with spirals? Consider concrete of grade M25 and steel of grade Fe 415.

0 Answers  


WHY WE SELECT U AS A PERTOLEUM ENGINEER THOUGH UR MARKS ARE LESS THEN OTHER APPLICANTS

0 Answers   ONGC,


i need to know abt renault nissan company and the rounds and type of questions asked by today

0 Answers  


What is smoke testing?

1 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)