@hamsterman ur reply is greatly appreciated but i'm a beginner and am unable to understand the higher concepts u used in ur program......wuld u mind keep it simple lyk using for loop 2 times i thnk in a shorter form of the program pls.... :-(
hamsterman is just having a bit of fun there. You can learn a lot from his over-complicated example though. (Just don't hand it in!)
What we're trying to say is that you must show us that you have at least made an attempt to solve this yourself first. We don't give out solutions to homework problems on this site.
Post the code you have so far and we will guide you...
yup i know that @cnoeval....... i finished the abv 2 questions myself trying a bit more....
but not able to figure out how to do this one ::::
1 1 1 1
1 1 1
1 1
1
not lyk this .... using for loop and why is nt this site portraying the correct question.
this is not the question is wrote ....
am sry am not able to write the exact question out here after writing in first line 1111 in the next i give a space then write 111 then next line i give 2 spaces and write 11 then next line 3 spaces 1.. i thnk u can figure out what the output shuld be ..... and @rocketboy9000 u can't just simply print the output.. pls do it using for loop..according the changed question as mentioned in this post..
EDIT: Seriously, that's how I would do it. And then I'd challenge the other kids to see if their programs are faster than mine. And I would win, of course, since all loops in my program are unrolled during compilation.
@m4ster r0shi i don't want this long program. Actually i don't get what u hav done as it is being not taught to me yet.
can't we do it using two 'for' loops and @Grey Wolf the picturisation u gav isn't correct. u did lyk an equilateral triangle, i am asking lyk a right angled trianlge form.....with the first line is as u mentioned, second line 1 space 3 '1's, 3rd line 2 spaces 2 '1's, 4th line 3 spaces 1 '1'. in a right angled form... And pls i want u guys to do as we do in Turbo C
Don't you get our point, Manmay? We're not going to give you a solution that you can use. There's a good reason we don't give out usable solutions to homework problems which I wrote out in this article: http://cplusplus.com/forum/articles/31015/
Show us that you've at least tried to solve this problem and we'll take you seriously. Until then, I'm sorry, but we won't.
@m4ster r0shi: Meh. You could have optimized that further. I'll leave it to you to see how. :)
Look, I'm sure there are billions of ways to solve this problem, but all the solutions you all have posted so far only mock. Please, there's no need for this. Let's wait and see if we get an attempt at solving the problem from the OP.
If we do, then we'll actually see what we can do to help him/her, and not do any further mocking. Now that the OP gave their attempt, we'll just follow the standard and courteous procedure. I'm sure you know which one I'm referring to: the one that almost always works well.
If we don't, the we should just let this thread die rather than flamebait with four useless and either overblown or oversimplified solutions. I, along with cnoeval and Null tried to get the OP to try, even while some of you just stood around and touted your 1337 c0d1n9 5k1llz.
Either way, I say enough of this nonsense. Those actions don't help anyone.
Albatross, I think you have a bit too much hope in people. The op has not made any effort in 4 days and several times basically said "do my homework". He even knows how it should be done, he just never tried. You can't help him, if he doesn't want to be helped. Why not mock him?
Hamsterman, just to say, this is not just about this thread; there's dozens of threads sharing the same fate while the OP may be willing to learn. Sure, it's not like that this time, but try thinking in the bigger image. ;)