Whenever someone starts journey towards any programming language.
The first question that arises in everyones mind is that what is program ?
and why we need that?
As we all know about computer is a electronic machine which is capable of uderstanding only
the machine language.
Machine language is a combination of only 0's and 1's .
It is also called as binary language.Computer could not do any task without if the instructions
which are provided to it in its machine language.
Computer only works on the instructions given to it,it not does work inherently.
Cmputer is combination of hardware and software.
Hardware is the physical components which we can touch,feel about it.
But without software hardware is just useless for us.
Telling the Computer What to Do
A computer program, also called software, is a way to tell a computer what to do. Everything that the computer does, from booting up to shutting down, is done by a program. Windows XP is a program. Ms. Pac-Man is a program. The dir command used in MS-DOS to display filenames is a program. Even an email virus is a program.
Computer programs are made up of a list of commands the computer handles in a specific order when the program is run. Each of these commands is called a statement.
How Programs Work
Most computer programs are written in the same way that you write a letter—by typing each statement into a word processor. Some programming tools come with their own word processor, and others can be used with any text-editing software.
When you have finished writing a computer program, you save the file just like saving any other document to disk. Computer programs often have their own filename extension to indicate what type of file they are. C programs have the extension .c;
an example of a C program filename is Calculator.c.
By the Way
If you use a fancy word processing program that has features such as boldface text, different font sizes, and other stylistic touches, do not use those features while writing a computer program. Programs should be prepared as text files with no special formatting. For example, when using Microsoft Word to write a program, save the file in Plain Text mode instead of saving it as a Word document. Notepad, a word processor that comes with Windows, saves all files as unformatted text. The vi editor on Linux systems also can be used to create text files without formatting.
To run a program you have saved as a file, you need some help. The kind of help that's needed depends on the programming language you're using. Some languages require an interpreter to run their programs. The interpreter is a program that interprets each line of a computer program and tells the computer what to do. Most versions of BASIC are interpreted languages. The advantage of interpreted languages is that they are faster to test. When you are writing a BASIC program, you can try it out immediately, spot any errors, fix them, and try again. The primary disadvantage is that interpreted languages run more slowly than other programs.
Other programming languages require a compiler. The compiler takes a computer program and translates it into a form that the computer can understand. It also does what it can to make the program run as efficiently as possible. The compiled program can be run directly, without the need for an interpreter. Compiled programs run more quickly than interpreted programs, but they take more time to test. You have to write your program and compile it before trying it out. If you find an error and fix it, you must compile the program again to verify that the error is gone.
C language requires a compiler . You'll learn more about this later as you write C programs.
No comments:
Post a Comment