I need to write a C++ code that will ask the user to enter either 1 or 2. If 1 is entered the program must count all even numbers from 0 to 100. (I got that part done) If 2 is entered you are suppose to prompt the user to enter their first, last, student id, and then print that information back for the user to see, if neither 1 or 2 is chosen, the program is to exit.

My problem is when i select 2, it will only let me enter the first name then it fills out the rest by itself. What did I do wrong?

#include <iostream>

using namespace std;

int main()
  int c,x=0;
  float nm1, nm2, sid;
 cout<<"Please enter either the number 1 or the number 2: "<<endl;
 if (c == 1)
   while (x <= 100)
         cout << x << endl;
         x = x + 2;
 else if (c == 2)
     cout<<"Please enter your first name: ";
     cout<<"Please enter your last name: ";
     cout<<"Please enter your student id ";
     cout<<"Your name is: "<< nm1<<nm2<< "and your student ID is: "<<sid<<endl;
     cout<<"you fail at following instructions, please try again"<<endl;

float nm1, nm2, sid;

maybe the problem is



string nm1, nm2

remember to include