Posts

C++ program which takes the book parameters and display them using structures

Image
#include<iostream> using namespace std; struct bookdetails { char name[50]; int page; char author[50]; string ibn;}; int main() { int i=1,j=1,k=1,l=1; struct bookdetails b1,b2,b3; while (i<=1) { cout<<"enter book names 1-3 "; i++; } cin>>b1.name>>b2.name>>b3.name; while (j<=1) {cout<<"no of pages of book 1-3 "; j++; } cin>>b1.page>>b2.page>>b3.page; while(k<=1) {cout<<"author name of book 1-3 "; k++; } cin>>b1.author>>b2.author>>b3.author; while (l<=1) { cout<<"IBN of book 1-3 "; l++; } cin>>b1.ibn>>b2.ibn>>b3.ibn; cout<<endl; cout<<"book name "<<b1.name<<endl; cout<<"pages "<<b1.page<<endl; cout<<"author "<<b1.author<<endl; cout<<"IBN "<<b1.ibn<<endl; cout<<endl; cout<...

Declare signed and unsigned integer

Image
Program Code #include <iostream> using namespace std; int main() { cout<<"INPUT"<<endl; int unsigned a; int signed b; cin>>a; cin>>b; cout<<"OUTPUT"<<endl; cout<<a<<endl; cout<<b; } Output

Make a program that take three integers and show the result in the ascending Order.

Image
PROGRAM CODE #include <iostream> using namespace std; int main() {  int a,b,c;  cout<<"Enter first Integer: ";  cin>>a;  cout<<"Enter Second Integer: ";  cin>>b;  cout<<"Enter Third Integer: ";  cin>>c;  if ((a>b)&&(b>c))  {  cout<<"The Ascedning order is"<<endl;  cout<<c<<endl;  cout<<b<<endl;  cout<<a<<endl;}  else if ((a<b)&&(b>c)&&(a>c))     {      cout<<"The Ascending order is"<<endl;      cout<<c<<endl;      cout<<a<<endl;      cout<<b<<endl;     }  else if ((a<b)&&(b<c))  {  cout<<"The Ascending order is "<<endl;  cout<<a<<endl;  cout<<b<<endl;  cou...