Advertisement
Felanpro

Awesome string project

May 28th, 2016
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdlib.h>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     string name;
  9.  
  10.     cout << "Type in your first name: ";
  11.     cin >> name;
  12.  
  13.     system("pause");
  14.  
  15.     int length_of_name = name.length() / 2;
  16.  
  17.     char middle_character_of_name = name.at(length_of_name);
  18.     cout << middle_character_of_name << endl;
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement