My problem is that the second scanf(" %s", name); doesn’t work. It just doesn’t wait for the user’s input.
int main()
{
int ID = 0;
char name[100];
float CGPA = 0;
printf("enter name\n");
scanf(" %s", name);
printf("enter float\n");
scanf("%.2f", &ID);
printf("enter name\n");
scanf(" %s", name);
system("PAUSE");
}
Why does it skip this scanf?
Your problem is at following line:
&CGPA..2), it’s up to user. Simple%fwill work fine.It should look like this:
Hope this helps.