I WANT TO KNOW WHY IS THIS CODE NOT TAKING INPUTS FOR "DESIGNATION"? : [WHY IS IT NOT TAKING INPUTS FOR "DESIGNATION"][1]

IF U CAN SEE THE OUTPUT FROM THE SCREENSHOT, THE fgets() function is running only once to take in the string "name", but it is not accepting the "designation" string and is skipping onto the "salary" input. What is intriguing me even more is the fact that this same code is running perfectly well in TurboC3....I am getting problems only with GCC compiler based IDE such as DevCPP and now in GCC itself in Linux. 

  #include<iostream>
  
  #include<conio.h>
  
  #include<stdio.h>

  #include<string.h>

  using namespace std;

  class emp
  
  {
	
      private:
	  
      char name[20],desig[20];
	
      int id;
	
      float salary;
	
      public:
	
      void getdata()
	  {
		cout<<"ENTER NAME:\n";
		fgets(name,20,stdin);
		cout<<"ENTER ID:\n";
		cin>>id;
		cout<<"ENTER DESIGNATION:\n";
		fgets(desig,20,stdin);
		cout<<"ENTER SALARY:\n";
		cin>>salary;
	}
    
    void showdata()
	{
		cout<<"NAME:- "<<name<<"\n";
		cout<<"ID:- "<<id<<"\n";
		cout<<"DESIGNATION: "<<desig<<"\n";
		cout<<"SALARY: "<<salary<<"\n";
	}
};

int main()

{
	
    emp ins[3];
	
    int i;
	
    cout<<"ENTER DETAILS:\n";
	
    for(i=0;i<3;i++)
	
    ins[i].getdata();
    
    cout<<"*****************************DETAILS***************************\n";
	
    for(i=0;i<3;i++)
	
    ins[i].showdata();
	
    return 0;
}



	
	


  [1]: http://i.stack.imgur.com/jG8LI.png