Friday, 4 January 2013

Download And Install Turbo C Free

Download And Install Turbo C Free


Download Install Turbo C Free

Turbo C is one of the earliest compiler for C programming language.It was introduced in 1987 by Borland but even now we can use it for developing programs.Today, C++ programming language is widely used for developing softwares and programs and C language is considered kind-of outdated.

However, most educational institutions and universities teach C language for students to get their first time experience with computer programming and coding.But the problem is the original Borland Turbo C compiler is not easily available on internet.If you search for turbo c on google, you're most likely to end up with some other compilers.So for the sake of students and those who are interested in C programming, I'm uploading the original Turbo C from Borland.

Download Turbo C : Download Turbo C Free( 1 MB )

P.S: Turbo C works with Windows XP and earlier versions only. Click here To download Turbo C for Windows 7 or later.

Installing Turbo C

Installing Turbo C and getting it to work is pretty easy.First, extract the contents of the zip file to any of your local disk.After that, open the folder TC and find TC.EXE. Open it, you will see Turbo C in small windows. To make Turbo C full screen, press Alt+Enter.For the compiler to work correctly, first you will have to make sure the directories are set correctly when you compile a C program, it will show a series of errors.

To change the directories, press F10 to enter menu the go to Options and select Directories.

Make sure, all the directory paths matches with the install location of TC.

For example, if you the TC folder on zip archive you downloaded to local disk C, then your directories should be like this...

Download and Insstall Turbo C Free
Save this option and you're ready to compile your c program.

Thursday, 3 January 2013

Data types in C


In C, variable(data) should be declared before it can be used in program. Data types are the keywords, which are used for assigning a type to a variable.

Data types in C

  1. Fundamental Data Types
    • Integer types
    • Floating Type
    • Character types
  2. Derived Data Types
    • Arrays
    • Pointers
    • Structures
    • Enumeration

Syntax for declaration of a variable

data_type variable_name;



Data Types in C :

"Data type can be defined as the type of data of variable or constant store."
When we use a variable in a program then we have to mention the type of data. This can be handled using data type in C.
Followings are the most commonly used data types in C.

KeywordFormat SpecifierSizeData Range
char%c1 Byte-128 to +127
unsigned char<-- -- >8 Bytes0 to 255
int%d2 Bytes-32768 to +32767
long int%ld4 Bytes-231 to +231
unsigned int%u2 Bytes0 to 65535
float%f4 Bytes-3.4e38 to +3.4e38
double%lf8 Bytes-1.7e38 to +1.7e38
long double%Lf12-16 Bytes-3.4e38 to +3.4e38

* QUALIFIER :

When qualifier is applied to the data type then it changes its size or its size.
Size qualifiers : short, long
Sign qualifiers : signed, unsigned

* ENUM DATA TYPE :

This is an user defined data type having finite set of enumeration constants. The keyword 'enum' is used to create enumerated data type.
Syntax:
enum [data_type] {const1, const2, ...., const n};

Example:
enum mca(software, web, seo);

* TYPEDEF :

It is used to create new data type. But it is commonly used to change existing data type with another name.
Syntax:
typedef [data_type] synonym;

OR

typedef [data_type] new_data_type;

Example:
typedef int integer;
integer rno;


Variables in C


Character Set :

A character refers to the digit, alphabet or special symbol used to data represetation.
  1. Alphabets :                 A-Z, a-z
  2. Digits :                       0-9
  3. Special Characters :    ~ ! @ # $ % ^ & * ( ) _ + { } [ ] - < > , . / ? \ | : ; " '
  4. White Spaces :            Horizontal tab, Carriage return, New line, form feed

Identifier :

Identifier is the name of a variable that is made up from combination of alphabets, digits and underscore.

Variable :

It is a data name which is used to store data and may change during program execution. It is opposite to constant. Variable name is a name given to memory cells location of a computer where data is stored.
* Rules for varibales:
  1. First character should be letter or alphabet.
  2. Keywords are not allowed to use as a variable name.
  3. White space is not allowed.
  4. C is case sensitive i.e. UPPER and lower case are significant.
  5. Only underscore, special symbol is allowed between two characters.
  6. The length of indentifier may be upto 31 characters but only only the first 8 characters are significant by compiler.
  7. (Note: Some compilers allow variable names whose length may be upto 247 characters. But, it is recommended to use maximum 31 characters in variable name. Large variable name leads to occur errors.)

Keywords :

Keywords are the system defined identifiers.
All keywords have fixed meanings that do not change.
White spaces are not allowed in keywords.
Keyword may not be used as an indentifier.
It is strongly recommended that keywords should be in lower case letters.
There are totally 32(Thirty Two) keywords used in a C programming.
intfloatdoublelong
shortsignedunsignedconst
ifelseswitchbreak
defaultdowhilefor
registerexternstaticstruct
typedefenumreturnsizeof
gotounionautocase
voidcharcontinuevolatile


Escape Sequence Characters (Backslash Character Constants) in C:

C supports some special escape sequence characters that are used to do special tasks.
These are also called as 'Backslash characters'.
Some of the escape sequence characters are as follow:
Character ConstantMeaning
\nNew line (Line break)
\bBackspace
\tHorizontal Tab
\fForm feed
\aAlert (alerts a bell)
\rCarriage Return
\vVertical Tab
\?Question Mark
\'Single Quote
\''Double Quote
\\Backslash
\0Null

Printf: Reading User Values


Printf: Reading User Values

C Errors to Avoid
  • Using the wrong character case - Case matters in C, so you cannot type Printf or PRINTF. It must be printf.
  • Forgetting to use the & in scanf
  • Too many or too few parameters following the format statement in printf or scanf
  • Forgetting to declare a variable name before using it
The previous program is good, but it would be better if it read in the values 5 and 7 from the user instead of using constants. Try this program instead:
#include <stdio.h>

int main()
{
    int a, b, c;
    printf("Enter the first value:");
    scanf("%d", &a);
    printf("Enter the second value:");
    scanf("%d", &b);
    c = a + b;
    printf("%d + %d = %d\n", a, b, c);
    return 0;
}
Here's how this program works when you execute it:
Make the changes, then compile and run the program to make sure it works. Note that scanf uses the same sort of format string as printf (type man scanf for more info). Also note the & in front of a and b. This is the address operator in C: It returns the address of the variable (this will not make sense until we discuss pointers). You must use the & operator in scanf on any variable of type char, int, or float, as well as structure types (which we will get to shortly). If you leave out the & operator, you will get an error when you run the program. Try it so that you can see what that sort of run-time error looks like.
Let's look at some variations to understand printf completely. Here is the simplest printf statement:
    printf("Hello");
This call to printf has a format string that tells printf to send the word "Hello" to standard out. Contrast it with this:
    printf("Hello\n");
The difference between the two is that the second version sends the word "Hello" followed by a carriage return to standard out.
The following line shows how to output the value of a variable using printf.
    printf("%d", b);
The %d is a placeholder that will be replaced by the value of the variable b when the printf statement is executed. Often, you will want to embed the value within some other words. One way to accomplish that is like this:
    printf("The temperature is ");
    printf("%d", b);
    printf(" degrees\n");
An easier way is to say this:
    printf("The temperature is %d degrees\n", b);
You can also use multiple %d placeholders in one printf statement:
    printf("%d + %d = %d\n", a, b, c);
In the printf statement, it is extremely important that the number of operators in the format string corresponds exactly with the number and type of the variables following it. For example, if the format string contains three %d operators, then it must be followed by exactly three parameters and they must have the same types in the same order as those specified by the operators.
You can print all of the normal C types with printf by using different placeholders:
  • int (integer values) uses %d
  • float (floating point values) uses %f
  • char (single character values) uses %c
  • character strings (arrays of characters, discussed later) use %s
You can learn more about the nuances of printf on a UNIX machine by typing man 3 printf. Any other C compiler you are using will probably come with a manual or a help file that contains a description of printf.

C Programm

Understanding Execution C Programm

Programming C

http://www.technoexam.com/c-language-lecture-study-notes-tutorials-material/introduction-to-c-programming.asp

Contents :

This section contains following key points that discusses the various key terminologies involved in C programming.