+3 votes
by kratos

What will be the output of the following program? Run this program and find out:

include<iostream.h>

struct Book { char *name;

char *author;

float royalty;

};

int main()

{

Book b1={"Computers","DBA",10.5};

Book *p;

p=&b1;

cout<<p->name<<p->author<

royalty<<"\n";

cout<

name<

author<

royalty<<"\n";

return 0;

}

1 Answer

+6 votes
by kratos
 
Best answer

Output:

CD10.5

ComputerDBA10.5

...