Free
|
|||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||
C Programming for beginners : How to get started with C LanguageHere we will teach how you can start and make your first C program. C language is middle level language`. To run a C program you need to have a C Compiler. Compiler is used to interpret our syntax (our program) into the machine code so that machine can understand our code.When we save the program an exe file along with Obj file is made. OBJ file is the machine code. You can easily download a Borland C compiler through internet. Log onto www.borland.com otherwise try searching on Google. After downloading its latest version, install c language on your system. DOWNLOAD COMPILER HEREAfter installing it you will find under TC folder - BGI | BIN | INCLUDE | LIB folders.Here we will only consider the BIN folder and the INCLUDE Folder for the moment. BIN folder contains TC.EXE. Execute this file then you will see something like we see below.
Note: All code written in c language is written in lower case letters
Go to File menu and click new as shown below
This is what you will see after clicking on new. (a blue colored screen or text writing screen, this is the place where you will write your first c program).
By default the page opens as NONAME00.CPP rename the file and save it by your name with extension as 'c' e.g name.c as shown below
Now write this code as shown below in your TC. This c program on compilation will print your name. For compiling this c program press ALT-F9.
The output on compilation will print this as follows
This is your first c program which prints your name. Similarly to we can make a addition program. (//-it is used for comments just to make you understand, every statement is terminated by; leaving the header files and functions)
ADD.C********************************************************************************** //C PROGRAM TO ADD TWO PRE DEFINED NUMBERS:#include<stdio.h> //header files in C found in INCLUDE directory#include<conio.h> //header files in C found in INCLUDE directory void main() //main function starts here { int a,b,c; //variables declaration clrscr(); //clears output screena=5;b=10; //variables values c=a+b; //addition of a and b gone to cprintf("%d",c);//printing c to output screen getch(); //to hold the screen } FREE C PROGRAMS : Get all Free C language Source code, Programs here!!
|
|||||||||||||||||||||||||||||||||||