Answer:
Explanation:
#include <iostream>
using namespace std;
int printroofln(int, int);
int printbodyln(int, int);
int main()
{
int hgt=0,odd=0,rhgt=0;
cout<<"Enter the height:";
cin>>hgt;
if ((hgt%2)==1) rhgt=(hgt/2)+1;
else rhgt=hgt/2;
for (int i=0;i<rhgt;i++)
{
printroofln(i,hgt);
}
for (int j=0;j<hgt;j++)
{
printbodyln(j,hgt);
}
return 0;
}
int printroofln(int rfln, int hgt)
{
int id1,id2,hlf=0;
hlf=hgt/2;
if ((hgt%2)==1)
{
id1=hlf-rfln;
id2=hlf+rfln;
}
else
{
id1=hlf-rfln-1;
id2=hlf+rfln;
}
for (int i=0;i<=hgt;i++)
{
if ((id1==i)||(id2==i))
cout<<"*";
else
cout<<" ";
}
cout<<endl;
return 0;
}
int printbodyln(int bln, int hgt)
{
for (int i=0;i<hgt;i++)
{
if ((bln==0)||(bln==(hgt-1))||(i==0)||(i==(hgt-1)))
{
cout<<"*";
}
else
{
cout<<" ";
}
}
cout<<endl;
return 0;
}
A program to demonstrate doubly linked list using pointers – insert (beginning, end, middle), delete(beginning, end, middle),view) is:
/* Initialize nodes */
struct node *head;
struct node *one = NULL;
struct node *two = NULL;
struct node *three = NULL;
/* Allocate memory */
one = malloc(sizeof(struct node));
two = malloc(sizeof(struct node));
three = malloc(sizeof(struct node));
/* Assign data values */
one->data = 1;
two->data = 2;
three->data = 3;
/* Connect nodes */
one->next = two;
one->prev = NULL;
two->next = three;
two->prev = one;
three->next = NULL;
three->prev = two;
/* Save address of first node in head */
head = one;
<h3>What is a Doubly Linked List?</h3>
This refers to the linked data structure that contains of a set of sequentially linked records called nodes.
The requested program is given above.
Read more about doubly linked list here:
brainly.com/question/13326183
#SPJ1
Answer:
The answer to this question can be described as follows:
Explanation:
The Pseudocode to this question can be described as follows:
start \\ start process
Declaration of variable
Input_File records.txt
Output_File result.txt
string author_Name
, title
int number_of_volume
open Input_File
open Output_File
input author_Name, title, number_of_volume from records.txt
while not eof \\ start loop and eof is end of file
output author_Name
output title
output number_of_volume
end while \\end loop
close records.txt \\close file
close results.txt \\close file
END \\end the code
Near-perfect eyesight and detail perception would be good traits to have.