The phone book program that enables users to enter names will be:
#include<stdio.h>
#include<stdlib.h>
struct phonebook{
char name[10];
double phoneno;
};
int main()
{
int t,i,total;
typedef struct phonebook phone;
phone *arr;
arr = (phone *)calloc(1,sizeof(phone));
printf("want to add a phone number:(0/1)\t");
scanf("%d",&t);
i = 1;
while(t!=0)
{
printf("enter name:\t");
scanf("%s",arr[i-1].name);
printf("enter phoneno:\t");
scanf("%lf",&arr[i-1].phoneno);
printf("want to add a phone number:(0/1)\t");
scanf("%d",&t);
i++;
arr = (phone *)realloc(arr,i*sizeof(phone));
}
total = i;
for(i=0;i<total-1;i++)
{
printf("name:\t%s",arr[i].name);
printf("\tphoneno:\t%.0lf\n",arr[i].phoneno);
}
A computer program is a set of instructions written in a programming language that a computer can execute. Software includes computer programs as well as documentation and other intangible components.
Source code refers to a computer program in its human-readable form. The program based on the information is illustrated above.
Learn more about program on:
https://brainly.com/question/26642771
#SPJ1