Enter details:
Enter book number:89
Enter book title:
Enter price:450
Enter no. of copies:2
Total cost:900
Enter book number:74
Enter book title:
Enter price:63
Enter no. of copies:2
Total cost:126
Details:
Book number:2424048
Book title:
Price:6.69737e-039
Total cost:1.33947e-038
Book number:0
Book title:
Price:0
Total cost:0
Input for book titile is not at all allowed as the input doen't even go there.
cout<<"\nEnter book number:";
cin>>bookno;
cout<<"\nEnter book title:";
cin.getline(booktitle, 100);
`getline()' stops at end of line, you press an <Return> after inputting the book number, so you get an empty string as the name.
you may cin.ignore() after using >>