Re: [algogeeks] C code scanf problem

2011-08-24 Thread vikas singh
On Wed, Aug 24, 2011 at 6:28 PM, Mehnaaz wrote: > #include > #define max 30 > int no_p; > int main() { > >char p[no_p][max]; >char x; >int i=0; >printf("enter the no of productions..\n"); >scanf("%d", &no_p); >printf("you have enter

Re: [algogeeks] C code scanf problem

2011-08-24 Thread lakshay girdhar
it takes \n as character on input buffer for each enter keystroke so use fflush(stdin); before 2nd scanf. On Wed, Aug 24, 2011 at 6:30 PM, Sanjay Rajpal wrote: > after first scanf, place a call to fflush(stdin). > > you will get the result. > > Sanju > :) > > > > On Wed, Aug 24, 2011 at 5:58 AM,

Re: [algogeeks] C code scanf problem

2011-08-24 Thread Sanjay Rajpal
after first scanf, place a call to fflush(stdin). you will get the result. Sanju :) On Wed, Aug 24, 2011 at 5:58 AM, Mehnaaz wrote: > #include > #define max 30 > int no_p; > int main() { > >char p[no_p][max]; >char x; >int i=0; >printf("enter the no of produc

[algogeeks] C code scanf problem

2011-08-24 Thread Mehnaaz
#include #define max 30 int no_p; int main() { char p[no_p][max]; char x; int i=0; printf("enter the no of productions..\n"); scanf("%d", &no_p); printf("you have entered :%d\n", no_p); printf("Variable who's FOLLOW y