A B C D E F G F E D C B A
A B C D E F F E D C B A
A B C D E E D C B A
A B C D D C B A
A B C C B A
A B B A
A A
how to generate the above output in c using for loop?
plz help me as soon as possible.
This is a discussion on program in c within the C Programming forums, part of the General Programming Boards category; A B C D E F G F E D C B A A B C D E F F ...
A B C D E F G F E D C B A
A B C D E F F E D C B A
A B C D E E D C B A
A B C D D C B A
A B C C B A
A B B A
A A
how to generate the above output in c using for loop?
plz help me as soon as possible.
C Board - Announcements in Forum : C Programming
C Board - Announcements in Forum : General Programming Boards
You've gotta make some kind of effort.
You can't just dump your assignment and expect us to do all your homework for you.
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.
I support http://www.ukip.org/ as the first necessary step to a free Europe.
Just kidding. Seriously though, here's the one I'd turn in:Code:#include <stdio.h> int main(void) { for(;;) { puts("A B C D E F G F E D C B A"); puts("A B C D E F F E D C B A"); puts("A B C D E E D C B A"); puts("A B C D D C B A"); puts("A B B A"); puts("A A"); break; } return 0; }
Code:#include <stdio.h> int main(void) { char *strings[] = { "A B C D E F G F E D C B A", "A B C D E F F E D C B A", "A B C D E E D C B A", "A B C D D C B A", "A B B A", "A A" }; int i; for(i = 0;i < 6;++i) puts(strings[i]); return 0; }
Last edited by itsme86; 03-11-2011 at 01:27 PM.
If you understand what you're doing, you're not learning anything.
Originally Posted by The Jargon File
If you understand what you're doing, you're not learning anything.