Answer:
#include <stdio.h>
struct Phonebook {
char name[30];
char address[30];
int phone_number;
};
int main()
{
struct Phonebook pb = {"John Josh", "Newyork", 5551234};
printf("Name: %s \n", pb.name);
printf("Address: %s \n", pb.address);
printf("Phone Number: %d \n", pb.phone_number);
return 0;
}
Explanation:
- Define a struct called Phonebook that has two character arrays to store the value for name and address, and an integer value to hold the phone number
- In the main, define pb to represent a person and assign default values
- Print the name, address and phone number of the pb (person)