#include<stdio.h>
int main()
{
int choice;
char sl[10];
char phn[10];
printf("Enter choice: ");
scanf("%d",&choice);
switch(choice)
{
case 1:
printf("\nEnter Student Details: \n\n");
printf("\nEnter serial number: ");
gets(sl);
printf("Roll number: ");
gets(phn);
default:
break;
}
return 0;
}
C PROGRAMMING:
I used 2 gets() function here. second one is working but first one is not working. why?? how to make it work?
N.B: I want to take "sl" and "phn" variable as char type and I want to use gets() to take input. please someone help....