take a look at the code.
when i ask for an input i like it to be a space between the question and the persons answer.
so i us \t to create a tab.
but when i run the program it gives me different spaces.
like this:

when i ask for an input i like it to be a space between the question and the persons answer.
so i us \t to create a tab.
but when i run the program it gives me different spaces.
like this:
Code:
#include <iostream.h>
#include <string.h>
#include <iomanip.h>
main()
{
char phone_number[] = "(000) 000-0000";
char zip_code[11];
char address[30];
char name[21];
char city[21];
char state[20];
cout << "Please enter your name:\t";
cin.get(name,21);
cin.ignore(80,'\n');
cout <<"Please enter your address:\t";
cin.get(address,30);
cin.ignore(80,'\n');
cout << "please enter your city:\t";
cin.get(city,21);
cin.ignore(80,'\n');
cout << "please enter your state:\t";
cin.get(state,20);
cin.ignore(80,'\n');
cout << "please enter your ZIP Code:\t";
cin.get(zip_code,11);
cin.ignore(80,'\n');
cout << "please enter your phone number:\t";
cin.get(phone_number,20);
cin.ignore(80,'\n');
cout << name <<'\n';
cout << address <<'\n';
cout << city << setw(10)<< state << setw(10)<< zip_code <<'\n';
cout << phone_number<<endl;
system("pause");
return 0;
}
Comment