What is the logical operator for but? I saw a sentence like,
I am fine but he has flu.

Now I have to convert it into logical sentence using logical operators. I do not have any idea what should but be translated to. Please help me out. 
Thanks
 A: This is indeed an exercise in semantics as mentioned by @Asaf. My interpretation would be:
$$fine(\text{me}) \land flue(\text{him})$$
where $fine, flue$ are predicates and me, him are constants.
Wiktionary lists various semantic meanings of 'but'. Here is an attempt to translate them into logic:


*

*But as preposition:
Everyone but Father left early: $\forall{X} [X \ne \text{father} \implies left(X)]$ 
I like everything but that: $\forall{X} [X \ne \text{that} \implies i\_like(X)]$

*But as adverb: 
Since that day, my mood has changed but a little: $changed(\text{mood}) \land small(\text{change})$

*But as conjuction: 
I have no choice but to leave: $\lnot choice (\text{me}) \land leave(\text{me})$ 
I am not rich but (I am) poor: $\lnot rich (\text{me}) \land poor(\text{me})$ 
(or if we asume $ poor \implies \lnot rich$, just $ poor(\text{me})$ ) 
She is very old but still attractive: $old(\text{she}) \land attractive(\text{she})$.  
It is instructive to translate these logical clauses into Prolog and to play with them.
Prolog and Natural Language Semantics is a good paper about translating English into Prolog.
A: I agree with Jiri on their interpretation. But coming from an AI background, I have a different sort of take:
Your example "I am fine but he has flu" has to do with the common knowledge between the speaker and the audience. The speaker has a certain belief of the above common knowledge. The attempt is to warn the audience that the proposition next to 'but' is unexpected, given the proposition before 'but'. 
Let us denote the proposition of a sentence $S$ before 'but' as $before(S)$ and after 'but' as $after(S)$. Lets denote the information content of a proposition $B$ when $A$ is already known as $I(B|A)$. Then, 'but' means: $I(after(S)|before(S)) > I(\lnot after(S)|before(S))$. That is, the information content (surprise) of $after(S)$ is more than $\lnot after(S)$ when $before(S)$ is already known. 
A: An alternative way of conveying the same information would be to say "I am fine and he has flu.".
Often, the word but is used in English to mean and, especially when there is some contrast or conflict between the statements being combined. To determine the logical form of a statement you must think about what the statement means, rather than just translating word by word into symbols.
A: This seems like an exercise in semantics. I cannot think of a logical operator which fits other than $\land$.
However, if we define the predicate $\operatorname{Fine}(x)$ which holds if and only if $x$ is fine, then we can assume "has the flu" is $\lnot\operatorname{Fine}(x)$.
In which case we can write the sentence:
$$\operatorname{Fine}(\textbf{me})\land\lnot\operatorname{Fine}(\textbf{him})$$
If you want to distinguish $\operatorname{Flu}(x)$ from simply $\lnot\operatorname{Fine}(x)$, then we are reduced to:
$$\operatorname{Fine}(\textbf{me})\land\operatorname{Flu}(\textbf{him})$$
A: But is a set meta-operator. It means "Union NOT".
Everything BUT the kitchen sink. {not K}
Nothing BUT the kitchen sink. {K}
All kitchen sinks BUT the ones with pink plugs. {K Subset not P}
(All)Kitchen sinks with pink plugs BUT in the case of round sinks only the sinks that are Metal {K Subset P Union (M Intersection R)
BUT, BUT ONLY - is an intersection (which can be defined in terms of NOT and AND) of one set with another set (sometimes with an implied set)
BUT NOT is a union of one set with the inverse of another set
A: Though usually you'll see "but" translated as logical conjunction (AND), the sense of such a statement seems to mean "I am fine, and he has the flue, so he is not fine also."  So with "f" meaning "I am fine", "l" meaning "he has the flue", "e" meaning "he is not fine", and it seems to mean "f, l|=e" where "|=" indicates entailment.  The teacher, almost surely, wants to you translate "but" as logical conjunction, but I simply don't see why you would want to so mindless translate into a logical statement, instead of translating it into a metalogical one.
A: In multi value logic BUT mean IF THEN ELSE.
So its like saying if you are A and he is B then
When B=flu THEN A=bad ELSE A=fine
A: But is not a logical connector, but a psychological one (how's that for demonstration?). You could say "but" is a conditioned logical connector; it plays no role in logical proofs. It is not a basic tool such as "and", "not", "if-then" and "equals." Keeping this in mind helps me realize what I can base my thinking on and what is purely ideational. Put briefly, "but" will never take you to the moon (and back, which is much more important!)
