If you want to get serious about programming learn the basics of the 'C' language first. Any book on ANSI C language will help you get started.
You can buy development books and software cheap off ebay.com plus there are some free compilers available for download such as DevC++ from Bloodshed software and the GNU C/C++ compiler.
Once you have learned the basic "building blocks" of 'C' you can then move up to Object Orientated Programming (OOP) and the C++ language. C++ is based on C but the OOP model makes more sense to program in.
Also, a working knowledge of C and C++ will help you when or if you decide to start dipping your toes into Java and the such because Java is largely based on the C language.
However, I don't suggest Java as a 'serious' language for developing mainstream Windows/Mac/Unix programs because it is still rather slow. You may wish to reserve this language for web-based development areas for the time being.
I'm assuming you are using Windows at the moment so I would suggest doing a search for and downloading the GNU C/C++ compiler for Windows to get a foothold.
All C programs have what's called a 'main' function where the program kicks into life. If you use GNU C/C++ to build your first program, you could enter the following code and compile and run it into a console window:
[tt]#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void)
{
printf("Hello World!"

;
return (0);
}[/tt]
the [tt]#include[/tt] directives at the top of the code are essentially telling the compiler to 'import' header files. There are a handful of basic header files for ANSI C. The three above (although not all required for this simple program) should be included in all your programs just out of habbit!
The [tt]int main(void)[/tt] is the 'main' function and starting point of the program. The body of a function is always enclosed in curly brackets { and } as you can see.
The word [tt]int[/tt] preceeding the function name is the return type of the function. In other words, the function is expected to return a value of type [tt]int[/tt] which means 'integer' or any whole number. You can see that once the function has completed in our case it [tt]return[/tt]s a value of zero (0).
The code in the function body gets executed in order from top to bottom. In our case, we have one simple statement[tt]printf("Hello World!"

;[/tt] - this tells the program to display the text "Hello World!" to your console window.
All statements in C/C++ end with a semi-colon (

- this tells the compiler that it is the end of the statement.
You can also do loops and branch off into different parts of your code by using [tt]while, do, for[/tt] loops and by defining other functions - here's a piece of code that uses both:
[tt]#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void some_function(int counter,char* str)
{
while(counter>0)
{
printf(str);
printf("\n"

;
counter = counter-1;
}
}
int main(void)
{
some_function(10,"Hello"

;
some_function(5,"World!"

;
return (0);
}[/tt]
The above code first calls [tt]some_function[/tt] with parameters of 10 and "Hello". Control slips into this function called [tt]some_function[/tt] - once in the function, the code in there is processed in order.
We enter a [tt]while[/tt] loop which has an integer (int) counter of a value of 10. While we're in the while loop, we print the word "Hello" which was passed in as the second parameter. We then print a newline character ("\n" = newline). The counter is then decremented by a value of one [tt]counter = counter-1;[/tt] so the value of counter is now 9.
The while loop compares the value of [tt]counter[/tt] to make sure it is 'greater than zero' ([tt]while (counter>0)[/tt]) before entering the loop again.
Obviously, once the value of [tt]counter[/tt] is zero, the loop completes, we exit the function (with no return value - hence the [tt]void[/tt] return value from [tt]some_function[/tt] and go back to [tt]main[/tt].
From [tt]main[/tt] we then enter the same function again but with different values as parameters.
This program should print "Hello" 10 times and then print "World!" 5 times to your console window.
I could have used certain shortcuts for decrementing the counter and such but I didn't want to confuse you at this point.
A word of warning: once you start programming, you can't stop! It's addictive!!
You start learning the basic stuff then use that knowledge as the building blocks for bigger and greater things. The possibilities become seemingly endless and before you know it, you have a copy of Visual C++ and you're building full blown windows apps which work and do things exactly as YOU want them!
programmer (prog'ram'er), n A hot-headed, anorak wearing, pimple-faced computer geek.