I can input both the strings. "Enter the name" and "Enter the director's name" get printed together in a row before i can input anything.... Plz run the program for details regarding what the problem is..Code:#include <conio.h> #include <iostream.h> struct movies { char name[50]; char director[50]; int rel; }; struct movies m1[20]; int main() { int i,n,view; do { cout<<"How many records do u want to input ? "; cin>>n; }while(n>20 || n<0); for(i=0;i<n;i++) { cout<<"\nEnter name : "; fgets(m1[i].name,50,stdin); cout<<"Enter the director's name : "; fgets(m1[i].director,50,stdin); cout<<"Enter release date : "; cin>>m1[i].rel; } cout<<"\n\nEnter the year you want to view : "; cin>>view; for(i=0;i<n;i++) { if(view==m1[i].rel) cout<<"\n"<<m1[i].name; } getch(); return 0; }