Thank you all!

Here's my new code taking Andurils advice:

Bolds indicates a change.

Code:

// More efficient than prime.c
// Prints out all prime numbers between 1 and n, including n.
// A prime number can only be divided by 1 and itself. 1 is not a prime number, lowest is 2.
#include <stdio.h>
int prime(int n) // Investigates if a number >= 3 is a prime number, returns 1 if true, 0 if false
{
int i, dividable;
dividable = 0;
for(**i = 3; i <= (n / 2); i = i + 2**) // No need to go further than n/2
{
if(n%i == 0)
{
printf("Testing if %d dividable by %d\n", n, i);
dividable = 1;
**break;**
}
}
if(dividable == 1)
return 0;
else
return 1;
}
int main(void)
{
int n, true_or_false ,i;
printf("Highest number: ");
scanf("%d", &n);
printf("Prime numbers between 1 and %d:\n", n);
**if(n < 2)
printf("No prime numbers in the range\n");
if(n >= 2)
printf("2\n");
**
for(**i = 3; i <= n; i = i + 2**)
{
true_or_false = prime(i);
if(true_or_false == 1)
printf("%d\n", i);
else;
}
return 0;
}

Hope this is more efficient than the last example.

Hm I wonder why the code above doesn't appear as colourful as in my first post.