Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- do-while_loop.c
- Task from Akira Reiss
- https://www.facebook.com/groups/177292205762971/user/100035107703976/
- https://www.facebook.com/photo/?fbid=491814215332164&set=gm.1867148806777294
- You can find all my C programs at Dragan Milicev's pastebin:
- https://pastebin.com/u/dmilicev
- */
- #include <stdio.h>
- int main(void)
- {
- int i=1, number;
- printf("\n Enter number from 1 to 9 : ");
- scanf("%d",&number);
- do {
- printf("%3d", i++);
- } while( i <= number );
- i = number - 1;
- while ( i > 0 ) {
- printf("%3d", i--);
- }
- return 0;
- } // main()
Add Comment
Please, Sign In to add comment