Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- //initialise variables
- char name[35] = {'\0'}; //init all to null, prevents junk
- char animal[20] = {'\0'};
- int birthday[6] = {'\0'};
- //get user input
- cout << "Please enter your full name, without spaces: ";
- cin >> name;
- cin.ignore(100,'\n');
- cout << "Please enter the name of your pet or favourite animal, without spaces: ";
- cin >> animal;
- cin.ignore(100,'\n');
- cout << "Please enter your birthday, in this format: 'DDMMYY': ";
- //cin >> birthday;
- cin.ignore(100,'\n');
- //ignore below this line, not done with program
- cout << name;
- cout << animal;
- cout << birthday;
- return 0;
- }
Add Comment
Please, Sign In to add comment