can somebody help me solve this quest
write a for loop which wll produce the followingoutput
1
22
333
4444
55555
can somebody help me solve this quest
write a for loop which wll produce the followingoutput
1
22
333
4444
55555
This quest doth indeed require a loop, unless thou desires recursion, template metaprogramming, or simple hard coding. Let us see what progress thy hath made, and we shall dispense advice with greater clarity.
(Pardon my possibly flawed attempt at being fancy, and remember to read and follow the homework policy as you venture on your quests.)
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
hey thank you so please can you help me coz i am still a freshman at uni
As I said, you should post what you have tried.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
ok let see whose the king of C++ U GIVE ME YOUR SOLUTIONS AND I'LL GIVE U MINE
No. My avatar is the witch queen of C++, and she seeks no suitors.
But the point is this: we are not going to do your homework. Do it yourself, and approach us if you need help in fixing or improving your solution.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
OK, try this one
Code:for ( i = 1000000 ; i <= 1000000 ; i++ ) { printf("1\n" "22\n" "333\n" "4444\n" "55555\n" ); }
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
hey thanks mate for your help i was just kidding about being the C++ KING THIS site is awesome
hey sorry about yesterday for being rude.i've got a quest do you think deitel &deitel books for C++ programming is also good to use or can u recommend any other books
We have a book recommendation thread stickied in this forum, and there is a new forum dedicated to reviews. By the way, as much as I enjoy poking fun at your "quests", please say "question" when you mean it.Originally Posted by luke luvevou
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
hey sorry for that somebody was disturbing me so i have to eliminate her
I don't know if this is right, but it works for me.
Code:#include <iostream> int main(int argc, char** argv) { for (int j=!argc; j-argc; j=j+!!argc, std::cout<<argc); { std::cout<<std::endl; } return !(argc-5)||main(!!argc+argc,argv); }
I copied it from the last program in which I passed a parameter, which would have been pre-1989 I guess. - esbo
Code:for (i=1;i<max;i++) { for(j=i;j>0;j--) { cout<<i; } cout<<"\n"; }
try similar logic i guess it will work