Create a function that will display the value of each member

Create a function that will display the value of each member (define function prototype, make a call) #include using namespace std:/* structure declaration *//* structure declaration *//*function prototype */Int main () {/* structure variable declaration *//*Initialization*//*Function call*/return 0;}/*function definition */

Solution

#include<iostream>

using namespace std;

struct Books {    // Declaring a structure for book which contains titile, author, ID of the book.

   char title[50];

   char author[50];

   char subject[100];

   int   book_id;

};

void function(struct Books book);            //function Prototype

int main()

{

struct Books Book1;        // Declare structure variable

Book1.title = “C++ Programming”;

Book1.author = “Bala Guruswamy”;

Book1.subject = “C++ Programming skills”;

Book1.book_id = 123450;

function(Book1);              // Calling the function.

return 0;

}

void function(struct Books Book1)           //function definition

{

cout<<”Title of book ::”<<Book1.title;

cout<<”Author of book ::”<<Book1.author;

cout<<”Subject ::”<<Book1.subject;

cout<<”book ID ::”<<Book1.book_id;

}

 Create a function that will display the value of each member (define function prototype, make a call) #include using namespace std:/* structure declaration *//

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site