Wednesday, July 16, 2008

Programmer's minD



What is program.................

An organized list of instructions that, when executed, causes the computer to behave in a predetermined manner. Without programs, computers are useless.

So, from this tiny definition we can understand what the hell it is !

In a prgram, we instructs the computer to do some kind of jobs with some variables ; here varibles act like ingradients.





There are many programming languages -- C, C++, Pascal, BASIC, FORTRAN, COBOL, and LISP are just a few. These are all high-level languages. We can also write prog in Low-level language like Assembly language .Low -level languages are difficult they are very closer to Machine-level language.

Tuesday, July 15, 2008

But High-level language are very easy to write as they are closer to human language.
there are also some middle-level languages like C where it acts like both- low and high-level language.


C is the mostcomfortable,user-friendly language.So,it is most acceptable language for the students.Now, its time to learn.
At first we have to knowwhat is Constant,variables and keywords??
Well, a constant is an entity dat doesn't change, whereas a variable is an entity dat may change.

C keywords


Keywords are the words whose meaning has already been explained to C compiler. The Keywords cannot be used as variable name.

There r only 32 keywords available in C.

they are-
auto,break,case char,const,continue,default,do,
double,else,enum,extern,float,for,goto,if,
int,long,register,return,short,signed,sizeof,static,
struct,switch,typedef,union,unsigned,void,volatile,while.

Monday, July 14, 2008

First C program

#include
#include
void main()
{
printf("Hello World");
}

u can run the prog. by pressing ctrl+F9;;
But wheres the output??
ok

here u have to put a function "getch()" at last of the prog.
so now type it->

#include
#include
void main()
{
printf("Hello World");
getch();
}

now run the prog. u will see Hello World 2 times.
the 1st one is the output of previous execution & the second one is of next execution.

#include:- now its enough to know that this is the syntax to call the header-files like(stdio,conio,math etc.); after calling this header files;we can run the functions like printf(),getch().

void main():- dis is the main function block from which all the codes are executed.we will discuss about function later.

{}:-by this parenthesis we can point the starting and the ending of a block.

printf():- this is the function used to print something.the text inside of the quotes " " will be printed.

getch():- its a function used to get character from keyboard i.e if u don't press any key then the statements after getch() will not be executed.