In case control 1 for loop is not executing. I don't understand why?
In case control 1 printf function is working but for loop is not. And turboc++ didn't get error and warning message after compiling.
Program I try :-
'''
#include<studio.h>
#include<conio.h>
void main()
{
clrscr();
int fun,inp,i;
printf ("Enter a number =
= ");
scanf ("%d",&inp);
printf ("\n");
printf ("Enter 1 for
reverse the number
\n");
printf ("ENTER = ");
scanf ("%d",&fun);
printf ("\n");
switch (fun)
{
case 1 :
printf ("\n Case 1 \n");
for (i=0;i>=inp;i++)
{
printf ("\n %d \n",inp);
inp=inp-1;
}
break;
}
getch();
}
'''
You may change the
forloop to :Or a bit shorter with one less variable :