fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4.  
  5. struct book{
  6. char name;
  7. float price;
  8. int pages;
  9.  
  10.  
  11. };
  12.  
  13. struct book b1,b2,b3;
  14. printf("Enter names,Prices & no.of pages of 3 books\n");
  15. scanf("%c%f%d",&b1.name,&b1.price,&b1.pages);
  16. scanf("%c%f%d",&b2.name,&b2.price,&b2.pages);
  17. scanf("%c%f%d",&b3.name,&b3.price,&b3.pages);
  18. printf("%c%f%d\n",b1.name,b1.price,b1.pages);
  19. printf("%c%f%d\n",b2.name,b2.price,b2.pages);
  20. printf("%c%f%d\n",b3.name,b3.price,b3.pages);
  21.  
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0s 2172KB
stdin
Standard input is empty
stdout
Enter names,Prices & no.of pages of 3 books
�-nan47
�0.0000001
4-nan1432616525