This Blog is for New Computer Prgrammers

Saturday, 3 December 2016

Hello World in C - Language

So dear ones Time to jump into the wonderland of C-Language, Going to describe you the very First Program in C - Language, that is must to enter otherwise there is no program in C - Language at all.

#include<stdio.h>
#include<conio.h>

void main(void)
{
clrscr();
pritnf("Hello World");
getch();
}

Here is the details about above mentioned program

Header Files
Remember one thing that all functionality of C - Language is stored inside some special Files called Header Files. Header Files have extension .h and are stored in include folder inside TC Folder when you install C Compiler.

Preprocessor Directives

# sign indicates the preprocessor directive, we have two preprocessor directives in C - Lanugage

  • include 
  • define


Include is used to add Header Files functionality in your program, and define is used to define Constants in C - Language

every C Program must start with preprocessor directive statements.

Main Function

Every Language starts its program from somewhere, so is the C Language, C Language Starts its Program from main function, the whole program is controlled from main function

Function Body
{ } Braces define the body of the function

inside the Body of the function we write our statements, 

clrscr() ; 
this statement clears the output screen

printf();
this statement writes the text given in double quotes on output screen

getch();
this statement is used to pause of output screen, it stays there until user presses any key from keyboard.


Role of Semicolon.
Semicolon is called statement terminator, so every C Language statement must end at Semicolon.

Share:

C - Development Environment


C - Development Environment

There are some basic Steps you have to keep in mind while working in C - Language Environment,  Remember one more thing i am using TURBOC Compiler for my this blog.

Writing your Programs.

First of all you have to write your program, for this you will have to invoke TurboC IDE Blue Screen by going 
c:\TC\Tc.exe

when your IDE loads you will see a blue screen if not so, FILE - NEW, all done.

write your program instructions here and save your file (FILE - SAVE or F2) with the extension .c anywhere in your computer but the best place is c:\tc\bin

Compiling your Program.

After writing the program, time to check either my program has some SYNTAX Errors or not, to do this we have to compile our program by Pressing ALT + F9, it will compile your program, if program has errors or warnings it will show you by popup a message box, and if everything is Ok it will create a new file .obj with the same name as you saved in previous step.

Source Program / Object Program

The Program you save in C Language with F2 is called your source program and the program file created by the compiler is called Object Program.

Linking your Program.

When the object program is created by the compiler, it is not executable, to make your Object program as Executable program you have to LINK some files with your object program this is done with a special process called Linking in C, to Invoke the Linker you can F9, it will add all required files with your object program and will create an Executable File with extension .EXE,

Running the Program.

When All is done so for, Time to Load the program in the Computer memory and let the Operating System to Execute your Program, This you can achieve by using CTRL + F9.


Share:

Saturday, 2 July 2016

What is Programming?


Introduction of Programming.

Hi! Dear Ones Today I am going to share my knowledge with you people about Programming, The Word programming means "Logic", Logic means use of your Brain to find a solution of your problems

Some body has very beautiful said "To become a programmer you need ATTITUDE, because without attitude one can become president of USA but without attitude one cannot become a programmer."

The word Programming came from Computer Field, as you know "Computer is an Electronic Machine that has a Brain along with Primary memory, can take input, Can Process this input, can store the input and processing results and can produce output as well".

As the computer is a machine with a brain but it cannot think and decide by itself, it has to program to do any thing, "Computer cannot do anything by its own, every thing is done under 'Programming'".

To Program the Computer One will have to learn "Computer Language", as earlier it was only Machine Language which is not readable by human beings easily, then invented Assembly language, and then people felt comfortable when High Level Languages were developed.

High Level language is a language that resembles the English Language, we Write Programs in this languages as we write Essays in English Language, we make small sentences called Statements, Special software called "Compilers" are used to convert these programs into machine readable form called "Object Program".

Here comes the C Language.

C is a Case Sensitive Language
C is High Level Language
C is Modular Language

C Language gave the idea of Structured programming, in which the Logic of a Full Program is not stored in a single Module but it is divided into small Modules and control these modules from a main module.

Program.
Program means set of instructions that tells the computer what to do, and how to do.

IDE (Integrated Development Environment)
The IDE is a fully functional program that provides every thing needed to write, save, compile and execute any C - Program.


Here is a look of C - Language IDE, This blue screen above is called "Editor" where type the C - Language Programs, then we save them with F2 key, remember one thing C and C++ are two different languages, C++ has more functionality than C, so when saving C File do not forget to save it with extension .C

Share:

Total Pageviews