Answer to Question #201366 in C++ for khanyo

Question #201366

The post office needs a program that reads in postal address data and then displays the data in a neat format.

declare four string variable name ,addr1, addr2 and postalCode.

First ,the main function of the program must input the data by means of a function called inputData



1
Expert's answer
2021-06-01T03:03:21-0400
#include<iostream>
using namespace std;
    void inputData(){
    int addr1,addr2,postalCode;
    char name[20];
    cout<<"Enter name"<<endl;
    cin>>name;
    cout<<"Enter address 1"<<endl;
    cin>>addr1;
    cout<<"Enter address 2"<<endl;
    cin>>addr2;

cout<<"postal code"<<endl;
cin>>postalCode;
cout<<"POSTAL INFORMATION"<<endl;
cout<<"Name "<<name<<endl;
cout<<"Address 1"<<addr1<<endl;
cout<<" Address 2 "<<addr2<<endl;
cout<<"postal code "<<postalCode<<endl;
    }
int main(){

inputData();
return 0;}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog