I am not getting output. When I enter the number of books it crashes.. I don’t know why!!! I am new C

You have a segmentation fault because you give an invalid argument to scanf:

scanf("%d",&num); // Give the address of the variable you want to set

By the way, you should use:

int main(void)

Leave a Comment