-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path8.12.cpp
More file actions
33 lines (33 loc) · 980 Bytes
/
8.12.cpp
File metadata and controls
33 lines (33 loc) · 980 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*Write a program that uses two structures Date ad PhoneBook. tHE date structure stores day,month, and year. PhoneBook structure stores name,city,
telephone and a Date type. The program declares a variable of type PhoneBook, inputs values and displays.*/
#include<iostream>
using namespace std;
struct Date{
int day,month,year;
};
struct PhoneBook{
char name[20],city[20];
unsigned phNo;
Date t;
}var;
int main(){
cout<<endl<<"Enter Name :";
cin>>var.name;
cout<<endl<<"Enter City Name :";
cin>>var.city;
cout<<endl<<"Enter Telephone No :";
cin>>var.phNo;
cout<<endl<<"Enter Day :";
cin>>var.t.day;
cout<<endl<<"Enter Month :";
cin>>var.t.month;
cout<<endl<<"Enter Year :";
cin>>var.t.year;
cout<<endl<<"\tName :"<<var.name;
cout<<endl<<"\tCity_Name :"<<var.city;
cout<<endl<<"\tTelephone No :"<<var.phNo;
cout<<endl<<"\tDay :"<<var.t.day;
cout<<endl<<"\tMonth :"<<var.t.month;
cout<<endl<<"\tYear :"<<var.t.year;
return 0;
}