Is there any formula to calculate the different structural formulae of a molecular formula?

for hydrocarbons, 2^{n-4}+1 where n is the number of carbons

I saw in one of the old questions from 2016 to calculate the structural formulae of C4H8F2. Can we use the formula in this case?

yes, the formula applies to all ALKANES, and C4H8F2 is theoretically like an alkane in structure (CnH2n+2)

How many unbranched straight chain molecules are there with the molecular formula C4 H8 F2 , but with different structural formulas?

A. 8

B. 4

C. 9

D. 12

E. 6

If we put the formula here, we get 2, but it key says E. How can I solve it?

Here in alkyl halides structural formulas, its the best to just draw all of the different isomers you can come up with and count them up - remember the fluorines can be almost anywhere in the structure. At least thats how I do it:)