Click here to Skip to main content
14,699,563 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
          0
         121
        23432
       3456543
      456787654
     56789098765
    6789012109876
   789012343210987
  89012345654321098
 9012345678765432109
012345678909876543210
Posted
Updated 17-Apr-13 22:48pm
v2
Comments
xenotron 18-Apr-13 4:30am
   

#include <stdio.h>

int main()
{
printf(" 0\n");
printf(" 121\n");
printf(" 23432\n");
printf(" 3456543\n");
printf(" 456787654\n");
printf(" 56789098765\n");
printf(" 6789012109876\n");
printf(" 789012343210987\n");
printf(" 89012345654321098\n");
printf(" 9012345678765432109\n");
printf(" 012345678909876543210\n");
return 0;
}
H.Brydon 18-Apr-13 17:02pm
   
I owe you a +5 for that one.
xenotron 19-Apr-13 4:29am
   
Thanks! :-)
Zoltán Zörgő 19-Apr-13 2:57am
   
My virtual 5 too!!!
xenotron 19-Apr-13 4:30am
   
Thank you! :-)

1 solution

We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, you may find it is not as difficult as you think!
   
Comments
OriginalGriff 18-Apr-13 5:30am
   
Yes.
OriginalGriff 18-Apr-13 5:40am
   
What part of "We do not do your homework" did you not understand? :laugh:

Come on, this isn't difficult!
What have you tried so far? Lets see if you can do it with some prompting...
OriginalGriff 18-Apr-13 5:58am
   
Tell you what, I'll give you a clue.
Look at the output: it's in three sections.
Spaces
Digits going up
Digits going down.

So your code is going to need three loops, one for each. (There are other ways, but thats the simplest)
OriginalGriff 18-Apr-13 7:35am
   
So you want us to do your interview question for you?
What is the salary I will earn when I pass the interview for you?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900