Continuous functions on a compact set Consider the following statement:

Let $K$ be a nonempty subset of $\mathbb R^n$, where $n\geq1$. Then If $K$ is compact, then every continuous real-valued function defined on $K$ is bounded. 

Here are my questions: 


*

*Is the converse true? (If every continuous real-valued function defined on $K \subset \mathbb R^n$ is bounded, then $K$ is compact)


Edit: According to the answers, I would like to add the following question:

Is the above statement true for
  every topological space?

 A: Hausdorff space $X = [0,\omega_1)$ with the order topology is pseudo-compact.  That means: every real-valued continuous function on $X$ is bounded.
A: Let $X$ be the topological space whose points are the natural numbers, with topology generated by the sets $\{0,n\}$ for all $n\in\mathbb{N}$.  Then $X$ is not compact, but every continuous function $X\to\mathbb{R}$ is constant.
A: In ${\bf R}^n$, compact means closed and bounded. If $K$ is not boounded, then $\sum|x_i|$ is a continuous unbounded function on $K$. If $K$ is not closed, let $a$ be a limit point of $K$ not in $K$, then the reciprocal of the distance to $a$ is continuous on $K$ and not bounded. 
A: As pointed out by others: the property that every real-valued (or equivalently $\mathbb{R}^n$-valued) continuous function on $X$ is bounded is called pseudocompactness. It's closely related to other notions: countable compactness (every countable open cover has a finite subcover) and sequential compactness (every sequence has a convergent subsequence).
For general spaces none of these are equivalent to compactness
or to each other, even for Tychonoff spaces. For metric spaces they are all equivalent to compactness, though. In general (say for Tychonoff spaces) we only that that sequential compactness implies countable compactness which in turn implies pseudocompactness, and compactness implies countable compactness (but not sequential compactness).
For normal spaces pseudocompact implies countably compact. For first countable spaces, countably compact implies sequentially compact. (More general theorems are possible.)
As G. Edgar pointed out, $[0, \omega_1)$ is a classical example of a sequentially compact, (and thus countably compact and pseudocompact) space that is very nice: first countable and hereditarily normal as well.
Another famous (in topology) example is Mrowka's Psi-space: consider a MAD family $\cal{A}$ on $\mathbb{N}$ (a maximal (w.r.t. inclusion) subfamily of infinite subsets of $\mathbb{N}$ 
such that any pair of them intersects in a finite set). Then define a space $X = \mathbb{N} \cup \{x_A \mid A \in \cal{A} \}$ and a topology on $X$ by declaring all points of $\mathbb{N}$ isolated, and a basic neighbourhood of $x_A$, $A \in \cal{A}$, is $A\setminus F$, where $F \subset A$ is finite. So points of $A \in \cal{A}$ converge to their $x_A$, and the finite sets we leave off ensures Hausdorffness (and thus Tychonov, as all basic open sets are clopen, and compact as well). The subset $\{ x_A \mid A \in \cal{A} \}$ of $X$ is infinite and discrete, so $X$ is not countably compact while the maximality of $\cal{A}$ ensures that $X$ is pseudocompact. It follows that $X$ is not normal (this also follows from Jones' lemma), and is an example of a locally compact Hausdorff, non-normal pseudocompact space that is not countably compact (so a fortiori not compact).
edit: original reference for Psi space 
