#include<iostream>
usingnamespace std;
int main()
{
int cno;
char cname[20];
char adress[20];
int a,b,c;
float i;
cout<<"Customer name :"<<endl;
cout<<"Customer adress :"<<endl;
cout<<"Customer Service number :"<<endl;
cout<<"Costumer Smart card number :"<<endl;
cout<<"Costumer Phone number :"<<endl;
cout<<"Customer Bill number :"<<endl;
cin>>cno;
cin>>cname;
cin>>adress;
cin>>a;
cin>>b;
cin>>c;
cin>>i;
}
If you want you input to look like the image. The first thing you will have to do is rearrange the program.
A line like cout<<"Customer name :"<<endl; with the "std::endl" will put the cursor on the next line. The way it should be written is:
1 2
std::cout << "Customer name : ";
std::cin >> cname;
This will print your prompt and leave the cursor at the end of the line. This format will need to be used for all your inputs.
Some other suggestions:
usingnamespace std; should be avoided as it WILL get you in trouble some day.
If you need your display to look like the image you have shown you will need to include the header file "<iomanip>" and use "std::setw()" to space the output correctly.
A double is preferred over the float for floating point numbers as it stores the number better and gives a better result in calculations.
The header file "<string>" and a std::string would be a better choice over the character arrays.