Compute the number of molecules
Do not use using namespace std. Read
this
Instead of using "magic numbers" in your program. Use symbolic
constants. CARBON_AMU and HYDROGEN_AMU should be ints. 

const int CARBON_AMU= 12;
const int HYDROGEN_AMU = 1;
const double AVOGADRO = 6.02214141070409084099072e23;

Utilize functions in your program, instead of initializing a
variable with an expression:

long formulaWeight(int carbonAtoms, int hydrogenAtoms){
    return((carbonAtoms * CARBON_AMU) + (hydrogenAtoms * HYDROGEN_AMU));
}

double numMolecules(float mass, long formulaWeight)
{
    return((mass / formulaWeight) * AVOGADRO);
}

(e.g. 10.5 2 6): " &lt;&lt; flush;

I don't see any advantage in using std::flush. You can remove it.
Fix your indentation. This is much easier to read:

cout &lt;&lt; mass &lt;&lt; " grams of hydrocarbon\nwith "
     &lt;&lt; carbonAtoms &lt;&lt; " carbon atom(s) and "
     &lt;&lt; hydrogenAtoms &lt;&lt; " hydrogen atom(s)\ncontains "
     &lt;&lt; molecules &lt;&lt; " molecules" &lt;&lt; endl;