Help me in this c programming structure question i dont understand why its giving this error please help

0 votes
asked Apr 11, 2018 by annonymus
#include<stdio.h>

#define size 10

struct books

{

    char title[25];

    char pub[25];

    int year;

    int status;

};

int main()

{

struct books books;

int i;

for(i=0;i<size;i++)

   {

   printf("Title : ");

   scanf("%s", &books[i].title);

   

   printf("Publication :%d ", books[i].pub);

   

 printf("Year :%d ", books[i].year);

   

 printf("Status :%s", books[i].status);

   printf("----------------------\n");

    }

  for(i=0;i<size;i++)

    {

   printf("\n", books[i].title"\t\t|"books[i].pub"\t\t|"a]books[i].year<<"\t\t|");

 if(books[i].status <=1985)

 {

 printf("Outdated OR Reference");

 }

 else if(books[i].status >= 1986 && books[i].status <=2000)

 {

 printf("Medium");

 }

 else

 {

 printf("Lates");

 }

    }

}

1 Answer

0 votes
answered Apr 11, 2018 by anonymous
Here is working code of yours.
https://onlinegdb.com/ry17X2ssz
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...