Finding the two largest three digit numbers missing from a text file
Reading input

In this specific case it doesn't make a difference, but try to break the habit of using code like:

while (!some_file.eof())


Under most circumstances this leads to incorrect behavior--in particular, it will typically result in processing the last item in the file twice. In this code, we're just setting a value in an array to 1, so setting it to 1 again doesn't change anything, and the bug is hidden. Still better to avoid it.

while(in &gt;&gt; data)
{   
    if (data &gt;= 100 &amp;&amp; data &lt;= 999)
        a[data] = 1;    
}


indentation

I'm a lot less than excited about your formatting, putting the first statement in a block on the same line as the block's opening brace:

while(!in.eof())
{   in &gt;&gt; data;

...

for(i=999;i&gt;=100;i--)
    {if(a[i]!=1)


The usual advice is to pick a style and use it consistently. I'd add one item to that though: unless you have a really good reason to do otherwise, pick one of the styles that's already reasonably well know and widely used (e.g., K&amp;R, OTBS, etc.)

Standard containers

Right now, your a is basically acting as a set. That it, it simply records what numbers are present/absent in a range. The standard library already provides std::set (and std::unordered_set, though it's probably not the best choice here) specifically for that purpose. It might be worth at least considering using one of these.

Simplification

Since we care about the numbers that are missing (rather than the ones that are present), we probably want to invert the sense of our set. Rather than inserting numbers as we encounter them, then searching for what's missing, we can start by inserting all the numbers from 100 to 999, then remove the numbers as we read them from the file. 

This way, when we're done reading the data from the file, our set contains exactly what we care about: the numbers in the specified range that were not present in the file (if any).

Note that this can be a little bit of a tradeoff. If we expect a lot of numbers to be missing, we could be adding a fair amount of extra work by inserting all the numbers to start with, then removing them as we read. In a case like this, with only ~900 items in the range, that's probably irrelevant though--inserting 900 items in a set is fast enough that it usually won't matter nearly as much as simplifying the code can/does.

Standard algorithms

We can also use standard algorithms to ease the job a bit, such as using std::copy_n to copy the last two items in the set to std::cout, assuming we find two or more missing numbers.

Use of braces

A fair number of people advise using braces around the statement(s) controlled by every if, while, for, etc. Personally I don't like (or usually follow) this advice, but it's pretty widespread, and if you decide to do otherwise, you should (IMO) be consistent about whether to do it or not.

Summary

Code incorporating all these could look something like this:

std::set&lt;int&gt; s;

for (int i = 100; i &lt; 1000; i++)
    s.insert(s.end(), i);

int data;

while (in &gt;&gt; data)
    s.erase(data);

if (s.empty())
    std::cout &lt;&lt; "All numbers were present\n";
else if (s.size() == 1)
    std::cout &lt;&lt; "The one missing number was: " &lt;&lt; *s.begin() &lt;&lt; "\n";
else {
    std::cout &lt;&lt; "The two largest missing numbers were: ";
    std::copy_n(s.rbegin(), 2, std::ostream_iterator&lt;int&gt;(std::cout, " "));
}