daily pastebin goal
66%
SHARE
TWEET

Untitled

a guest Jan 21st, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     #include <iostream>
  2.     using namespace std;
  3.      
  4.      
  5.     int main()
  6.     {
  7.             //initialise variables
  8.             char name[35] = {'\0'}; //init all to null, prevents junk
  9.             char animal[20] = {'\0'};
  10.             int birthday[6] = {'\0'};
  11.            
  12.             //get user input
  13.             cout << "Please enter your full name, without spaces: ";
  14.             cin >> name;
  15.             cin.ignore(100,'\n');
  16.            
  17.             cout << "Please enter the name of your pet or favourite animal, without spaces: ";
  18.             cin >> animal;
  19.             cin.ignore(100,'\n');
  20.            
  21.             cout << "Please enter your birthday, in this format: 'DDMMYY': ";
  22.             //cin >> birthday;
  23.             cin.ignore(100,'\n');
  24.            
  25.             //ignore below this line, not done with program
  26.             cout << name;
  27.             cout << animal;
  28.             cout << birthday;
  29.            
  30.             return 0;
  31.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top