title: C programming get Information from the user
body: <p>This my first using C
   I need to ask user some information to enter</p>
  
  <pre><code> #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main(void) {
      int age;
      int i;
      char last_name[20];
      char first_name[20];
      double wight;
      char gender[1];
  
  
      printf("Enter your age: ");
      scanf("%d", &amp;age);
      printf("Enter your last name: ");
      fgets(last_name, 18, stdin);
          i = strlen(last_name)-1;
          if( last_name[ i ] == '\n')
              last_name[i] = '\0';
  
      printf("Enter your first name: ");
      fgets(first_name, 18, stdin);
              i = strlen(first_name)-1;
              if( first_name[ i ] == '\n')
                  first_name[i] = '\0';
  
      printf("Enter your wight: ");
      scanf("%lf", &amp;wight);
      printf("Enter your gender m/f: ");
      gets(gender);
  
      printf("You entered %s successfully\n ", first_name);
      return EXIT_SUCCESS;
  }
  </code></pre>
  
  <p>If I run the program 
   <strong>Enter your age: 23
   Enter your last name: Enter your first name:</strong> </p>
  
  <p>I did not give me chance to enter the last name
   it jump to next line</p>
  
  <p>I am using eclipse ide</p>