top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

Write a C program without using any loop to print numbers from 1 to 100 and 100 to 1 ?

0 votes
105 views
Write a C program without using any loop to print numbers from 1 to 100 and 100 to 1 ?
posted Apr 18, 2017 by Purabi Sarkar

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

/*Program: printing nos. From 1 to 100 and from 100 to 1 without using loops*/

#include<stdio.h>
#include<conio.h>
void main()
{
   int i=1;

   loop:
      printf("%d ",i++);
      if(i<=100)
         goto loop;

   printf("\n\n");
   i--;     //setting i equal to 100

   loop_again:
      printf("%d ",i--);
      if(i>0)
          goto loop_again;
}
answer Apr 18, 2017 by anonymous
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...