3.3 Compile and Run
Next step is to check the output of the program.
How ? well, press F10, use arrow keys to move to compiletab, press
, choose the option
.During the compilation the compiler will generate ﬁleswith name
hello.bak, hello.map, hello.obj, hello.exe
. Weare inerested in
, this is the executable ﬁle forDOS environment that will give us output.
How ? well, press F10, use arrow keys to move to runtab, press
, choose the option
.The program will get exectued. It prints the desiredoutput to output screen and then, Integrated Devel-opment Environment (IDE) of Turbo C start once again.To see the output screen press
ALT + F5
Congratulation, U done it.
the names of variables, functions, labels, and variousother user-deﬁned objects are called identiﬁers. Theseidentiﬁers can vary from one to several characters. Theﬁrst character must be a letter or an underscore, andsubsequent characters must be either letters, digits, orunderscores.In C, identiﬁers may be of any length. However, not allcharacters will necessarily be signiﬁcant. If the identiﬁeris not used in an external link process, then at least theﬁrst 31 characters will be signiﬁcant. In C++, there isno limit to the length of an identiﬁer, and at least theﬁrst 1,024 characters are signiﬁcant. In an identiﬁer, up-per and lowercase are treated as distinct. Hence, count,Count, and COUNT are three separate identiﬁers. Anidentiﬁer cannot be the same as a keyword, and shouldnot have the same name as functions that are in the li-brary.
Correct : abcd, Var_2, _env_, envVarIncorrect : 1abc, var-2, ab c, this, var...2
C has 32 keywords that, combined with the formal Csyntax, form the C programming language. Of these, 27were deﬁned by the original version of C, and ﬁve morewere added by the ANSI C committee: enum, const,signed, void, and volatile.
auto double int structbreak else long switchcase enum register typedefchar extern return unionconst float short unsignedcontinue for signed voiddefault goto sizeof volatiledo if static while
4.3 Basic Data Type
There are ﬁve atomic data types in C, listed below withtheir size in byte.
Type Keyword Size Rangevalueless void 0 nilcharacter char 1 -128 to 127integer int 2 -32768 to 32767floating-point float 4 6 digit precisiondouble floating-point double 8 10 digit precision
4.4 Modiﬁer of Basic Data Type
Except for type void, the basic data types may have var-ious modiﬁers preceding them. You use a modiﬁer toalter the meaning of the base type to ﬁt various situa-tions more precisely. The list of modiﬁers is as follows :signed, unsigned, long, short
A variable is a named location in memory that is usedto hold a value that may be modiﬁed by the program.All variables must be declared before they can be used.The general form of a declaration is.type variable list;Here, type must be a valid data type plus anymodiﬁers, and variable list may consist of one or moreidentiﬁer names separated by commas. Here are somedeclarations:
int i,j,l;short int si;unsigned int ui;double balance, profit, loss;
Variables will be declared in three basic places: insidefunctions, in the deﬁnition of function parameters, andoutside of all functions. These are local variables, formalparameters, and global variables.2