Am trying to write a program that read some question and answer in a text file and after displaying it in another text file and i want to make use of struct in my program. How do i go about it using rand() to generate the question.

Anyone one with suggestion please?

Why would you want to "display" the question "in another text file"? Don't you need it on the screen so the person can read the question and answer it?

For your struct, what do you think you need in it?

I'd like you to check your book's index for rand(), or your man pages (if you're on Linux), or your help icon, if you're on Windows, search the forum for "rand()", or even Google "rand() in C".

When you have a specific problem with your code, then post your code, and be specific about what the problem is.

We try to solve problems with C programs, but tutoring is substantially different, and forums are not good places to tutor from. C (like all programming languages), requires way too much detail for posts that are expected to be virtually unviewed, within a month or less.