I have made the following C program to print the roll and name of a person after taking input from the user.
#include<stdio.h>
#include<conio.h>
main()
{
int roll;
char name[50];
printf("\nEnter roll: ");
scanf("%d",&roll);
printf("\nEnter name: ");
gets(name);
printf("\n%d",roll);
puts(name);
}
But the problem is, when I run the program, the program terminates without taking the 'name' input. Why is this happening?