Answer to Question #248021 in C++ for asdasd

Question #248021

The program should accept 5 records of books and displays them on the screen


1
Expert's answer
2021-10-07T10:03:53-0400
#include <iostream>

struct book {
 string name;
 int pages;
 int isbn;
};

int main() {
 for (int i = 0; i < 5; i++) {
  book b;
  std::cin >> b.name >> b.pages >> b.isbn;
  std::cout << i + 1 << std::endl;
  std::cout << "name: " << b.name << std::endl;
  std::cout << "pages: " << b.pages << std::endl;
  std::cout << "isbn: " << b.isbn << std::endl;
 }
 return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS