Jump to Post
scanf("%d%d", &x[q], &x[q]);
Notice the ampersand (address-of operator). scanf() requires a pointer to an object, and you were passing some random number which was extremely unlikely to be a valid address in your address space.
All 2 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.