HTML is a language for describing web pages.
- HTML stands for Hyper Text Markup Language
- HTML is not a programming language, it is a markup language
- A markup language is a set of markup tags
- The purpose of the tags are to describe page content
- HTML tags are keywords (tag names) surrounded by angle brackets like <html>
- HTML tags normally come in pairs like <b> and </b>
- The first tag in a pair is the start tag, the second tag is the end tag
- The end tag is written like the start tag, with a forward slash before the tag name
- Start and end tags are also called opening tags and closing tags
- An HTML element starts with a start tag / opening tag
- An HTML element ends with an end tag / closing tag
- The element content is everything between the start and the end tag
- Some HTML elements have empty content
- Empty elements are closed in the start tag
- Most HTML elements can have attributes
Tip: You will learn about attributes in the next chapter of this tutorial
HTML Tip: Use Lowercase Tags HTML tags are not case sensitive: <P> means the same as <p>. Many web sites use uppercase HTML tags.
W3Schools use lowercase tags because the World Wide Web Consortium (W3C) recommends lowercase in HTML 4, and demands lowercase tags in XHTML.
W3Schools use lowercase tags because the World Wide Web Consortium (W3C) recommends lowercase in HTML 4, and demands lowercase tags in XHTML.
HTML or HyperText Markup Language, is a Universal language that allows an individual using special code to create web pages to be viewed on the Internet. Below is an example of HTML code that creates a link that says "Visit Computer Hope" and goes to the Computer Hope web page if clicked. This is just one example of hundreds of other HTML meta tags.
HTML Developed by Tim Berners-Lee in 1990, HTML is short for HyperText Markup Language and is a language used to create electronic documents, especially pages on the World Wide Web that contain connections called hyperlinks to other pages. Every web page you see on the Internet, including this one contains HTML code that helps format and show text and images in an easy to read format. Below is an example of a basic web page in HTML code
html>
<head>
<title>multiple-choice quiz form</title>
</head>
<body bgcolor=#ffffff>
<h3>Pangutana</h3>
<form method="post" action="mailto: [email protected]?subject=Pangutana" enc>
Check the answer to each multiple-coice question, and click on the "Send Form" button to submit the information.
<P>1. Ang akong ganahan nga website is:<BR>
<input name="1.Naay logo og akong picture is" value="Naay Logo og akong picture">Naay Logo og akong picture<BR>
<input name="1.Naay mga pictures is" value="Naay mga pictures">Naay mga pictures<BR>
<input name="1.Naay links sa mga websites is" value="Naay links sa mga websites">Naay links sa mga websites<BR>
<input name="1.Naa tanan is" value="Naa tanan">Naa tanan<BR>
</p>
<P>2. Ang akong ganahan nga design is:<BR>
<input name="2. Defaut design from the web is" value="Default design from the web">Default design from the web<BR>
<input name="2. Custom HTML codes is" value="Custom HTML codes">Custom HTML codes<BR>
<input name="2. Design naay nature is" value="Design naay nature">Design nay nature<BR>
<input name="2. Design naay dagat is" value="Design naay dagat">Design naay dagat<BR>
</p>
<P>3. Ang akong ganahan nga school is:<BR>
<input name="3. School dunay mga computers is" value="School dunay computers">School dunay computers<BR>
<input name="3. School dunay mga equipment is" value="School dunay mga equipment">School dunay mga equipment<BR>
<input name="3. School dunay mga playgrouund is" value="School dunay mga playground">School dunay mga playground<BR>
<input name="3. School layo sa highway is" value="School layo sa highway">School layo sa highway<BR>
</p>
<br>
<br>
<br>
<br>
<h4>What is your ideal output?</h4>
<FORM method="POST"
onSubmit="return checkAnswer(this,'B');"
>
<INPUT VALUE="A" NAME="cc">
A. Colorful<BR>
<INPUT VALUE="B" NAME="cc">
B. Black with discription<BR>
<INPUT VALUE="C" NAME="cc">
C. with picture and discription<BR>
<INPUT VALUE="Submit Answer"><form method="post" action="mailto:[email protected]?subject=Vocabulary Quiz 1" enc>
</FORM>
</body>
</html>
<head>
<title>multiple-choice quiz form</title>
</head>
<body bgcolor=#ffffff>
<h3>Pangutana</h3>
<form method="post" action="mailto: [email protected]?subject=Pangutana" enc>
Check the answer to each multiple-coice question, and click on the "Send Form" button to submit the information.
<P>1. Ang akong ganahan nga website is:<BR>
<input name="1.Naay logo og akong picture is" value="Naay Logo og akong picture">Naay Logo og akong picture<BR>
<input name="1.Naay mga pictures is" value="Naay mga pictures">Naay mga pictures<BR>
<input name="1.Naay links sa mga websites is" value="Naay links sa mga websites">Naay links sa mga websites<BR>
<input name="1.Naa tanan is" value="Naa tanan">Naa tanan<BR>
</p>
<P>2. Ang akong ganahan nga design is:<BR>
<input name="2. Defaut design from the web is" value="Default design from the web">Default design from the web<BR>
<input name="2. Custom HTML codes is" value="Custom HTML codes">Custom HTML codes<BR>
<input name="2. Design naay nature is" value="Design naay nature">Design nay nature<BR>
<input name="2. Design naay dagat is" value="Design naay dagat">Design naay dagat<BR>
</p>
<P>3. Ang akong ganahan nga school is:<BR>
<input name="3. School dunay mga computers is" value="School dunay computers">School dunay computers<BR>
<input name="3. School dunay mga equipment is" value="School dunay mga equipment">School dunay mga equipment<BR>
<input name="3. School dunay mga playgrouund is" value="School dunay mga playground">School dunay mga playground<BR>
<input name="3. School layo sa highway is" value="School layo sa highway">School layo sa highway<BR>
</p>
<br>
<br>
<br>
<br>
<h4>What is your ideal output?</h4>
<FORM method="POST"
onSubmit="return checkAnswer(this,'B');"
>
<INPUT VALUE="A" NAME="cc">
A. Colorful<BR>
<INPUT VALUE="B" NAME="cc">
B. Black with discription<BR>
<INPUT VALUE="C" NAME="cc">
C. with picture and discription<BR>
<INPUT VALUE="Submit Answer"><form method="post" action="mailto:[email protected]?subject=Vocabulary Quiz 1" enc>
</FORM>
</body>
</html>
turbo c programming
The History of Turbo C Language is an Integrated Development Environment and compiler for the C programming language from Borland. Firstintroduced in 1987, it was noted for its integrated development environment, small size, extremely fast compile speed,comprehensive manuals and low price.In May 1990, Borland replaced Turbo C with Turbo C++. In 2006, Borland reintroduced the moniker.The beginningsIn the early 1980s, Borland enjoyed considerable success with their Turbo Pascal product and it became a popular choice
when developing applications for the PC. Borland followed up that success by releasing Turbo Basic, Turbo Prolog andTurbo C.Turbo C had the same properties as Turbo Pascal: an integrated development environment (IDE), a fast compiler, a goodeditor and all that for a cheap price. Nevertheless, Turbo C was not as successful as the Pascal-sister product. First, Cwas not a school language such as Pascal, but rather a language for professional programming and systemsdevelopment. Turbo C was therefore competing with a full field of professional programming tools (Microsoft C, LatticeC, Watcom C, etc.). Turbo C did, however, have advantages in speed of compiled code, the ability for large projects to beimplemented, and compared to competing compilers a very low price.
Version history
Version 1.0
, on May 13, 1987 - It offered the firstintegrated edit-compile-run development environmentfor C on IBM PCs. The software was, like manyBorland products of the time, bought from another company and branded with the "Turbo" name, in this case
Wizard C
by Bob Jervis (The flagship Borlandproduct at that time, Turbo Pascal, which at this timedid not have pull-down menus, would be given a faceliftwith version 4 released late in 1987 to make it look more likeTurbo C.) It ran in 384 kB of memory. It allowed inlineassembly with full access to C symbolic names andstructures, supported all memory models, and offeredoptimizations for speed, size, constant folding, and jumpelimination.
Version 1.5
, in January 1988 - This was anincremental improvement over version 1.0. It included moresample programs, improved manuals and other bug fixes. Itwas shipped on five 360 KB diskettes of uncompressed files, and came with sample C programs, including a strippeddown spreadsheet called mcalc. This version introduced the <conio.h> header file (which provided fast, PC-specificconsole I/O routines). (Note: The copyright date in thestartup screen is 1987, but the files in the systemdistribution were created in January 1988.)
Version 2.0
, in 1989 - The American release was in late1988, and featured the first "blue screen" version, whichwould be typical of all future Borland releases for MS-DOS. The American release did not have Turbo Assembler or a separate debugger. (These were beingsold separately as the product Turbo Assembler.)See this ad for details: Turbo C, Asm, and Debugger were sold together as a professional suite of tools.
http://www.scribd.com/doc/62396755/The-History-of-Turbo-C
Some examples of the uses of C are: -Operating System
-Language Compliers
-Assemblers
-Text Editors
-Print Spoolers
-Network Devices
-Modem programs
-Databases
-Language Interpreters
-Utilities Features of C Language -A simple core language, such as math functions or file handling provided by a standard set of library routines.
-Focus on procedural programming paradigm which facilitates for programming in a structured style.
-Parameters are always passed by value, never by reference.
-C is flexible when it allows unrestricted conversion of data from one type to another, such as conversion of a character to its numeric equivalent. CHAPTER 1: FLOWCHARTING AND ALGORITHMS 1.1 Flowchart Defined
-"Use of symbols and phrases to designate the logic of how a problem is solved" (SCHN95).
-"A common method for defining the logical steps of flow within a program by using a series of symbols to identify the basic Input, Process and Output (IPO's) function within a program" (TRA196).
-"A two-dimensional representation of an algorithm; the predefined graphic symbols of a flowchart are used to indicate the various operations and the flow of control" (SWAZ89).
-"A diagram representing the logical sequence in which a combination of steps or operations is to be performed. It is a blueprint of the program" (LAPU86).
1.2 Algorithm Defined
-"Algorithm is a finite set of instructions that can specify a sequence of operations to be carried out in order to solve a specific problem of class of problems" (SWAZ89).
Terminal Symbol
Used to signify the beginning and end of flowchart Preparation or Initialization Symbol Signifies the preparation of data
Used to select initial conditions
Used to represent instructions or group of instructions that will alter or modify a program's course of execution. Input / Output "Shows input and output. Data are to be read into the computer memory from an input device or data are to be passed from the memory to an output device" (SWAZ89) Processing
Performs any calculations that are to be done Decision Signifies any decision that are to be done
"Two alternative execution paths are possible. The path to be followed is selected during the execution by testing whether or not the condition specified within the outline is fulfilled" (SWAZ89) On-page Connector "Shows the entry or exit point of the flowchart" (SWAZ89)
"A non-processing symbol used to connect one part of a flowchart to another without drawing flowlines" (LAU86).
"Conserves space by keeping related blocks near one another, reduces the number of flowlines in complex programs, and eliminates cros lines from taking place" (LAPU86). Off-page Connector "Designates entry to or exit from one page when a flowchart requires more than one page" (LAPU86) Flowlines Signifies the process that is to be executed next Turbo C Environment Four Parts of Turbo C Environment
1. Main menu
2. Editor status line and edit window
3. Compiler message window
4. "Hot key" quick reference line Turbo C`s Main Menu
The main menu is used to choose an instructions for the Turbo C what to do.
There are two ways of selecting the main menu, First, by arrow key to move and
highlight the selected menu and followed by pressing the enter button. Second,
by simply hitting the alt key + the desired menu to select.
Example: alt + F for file or alt + P for project.
Menu item with its description:
File - Loads and save files,invokes DOS, and handles directories.
Edit - Invokes the Turbo C Editor.
Run - Compiles, links and runs the program currently loaded in the work area.
Compile - Compiles the program currently in the work area.
Project - Manges multi-file projects.
Options - Sets various compiler, linker, and the environment options.
Debug - Sets various debug options.
Break/watch - Manages debugger watch expressions and break points
Note: if some of the info above are wrong kindly take time to comment for revising the entry.
Submenus under File menu (SCH192)
a. Load-enables the user to select a file to be opened or loaded into the editor.
b. Pick-enables the user to select a file based on the nine files previously opened or edited.
c. New-lets the user edit a new file or start new programs.
d. Save-store or "saves the file currently in the editor" (SCH192).
e. Write to-enables the user to "save a file using a different filename" (SCH192).
g. Change dir-enables the user to specify the defined path to change the default path or directory.
h. OS Shell-"loads the DOS command processor" and lets the user "execute DOS command processor" and lets the user "execute DOS commands" (SCH192).
i. Quit-lets the user to exit or quit Turbo C. Turbo C Language Hot Keys
Hot Keys
F1 - Online help
F2 - Saves the current file being edited
F3 - Loads a file
F5 - Zooms the window
F6 - Switches between the window
F7 - Trace
F8 - Step
F9 - Compiles and links your program
F10 - Toggles between the main menu and the editor
Alt-F1 – last help screen
Alt-F3 – allows you to pick a file to load
Alt-F5 – switches between environment screen and output screen
Alt-F7 – previous error
Alt-F8 – next error
Alt-F9 – compiles file to .OBJ
Alt-C – Compile menu
Alt-D – Debug menu
Alt-E – Edit menu
Alt-F – File Menu
Alt-O – Option Menu
Alt-P – Program Menu
Alt-R – Run Menu
Alt-X – Quits Turbo C
Ctrl-F1 – requests help about the item which contains in the cursor
Ctrl-F9 – Runs the program
Data Types for Turbo C
Data Types
There are five elementary data types in C: characters (char), integer (int), floating point, double floating point and void. "Values of type char are used to hold ASCII characters or any 8-bit quantity. Variables of type int are used to hold integer quantities. Values of type float and double are used to hold real numbers. Real numbers have both an integer and fractional component. The type void has three uses: The first is to declare explicitly a function as having no parameters. The third is to create generic pointers" (SCHI92).
Type Bidwidth Range
char 8 0 to 255
int 16 -32768 to 32767
float 32 3.4E-38 to 3.4E+38
double 64 1.7E-308 to 1.7E+308
void 0 valueless
Size and Range of Turbo C's Basic Data Types
Type Modifiers
Except type void, the basic data types may have various modifiers preceding them. "A modifier is used to alter the meaning of the base type to fit the needs of various situations more precisely. The list of modifiers includes the following" (SCHI92:
signed
unsigned
long
short
Type Bidwidth Range
char 8 -128 to 127
unsigned char 8 0 to 255
signed char 8 -128 to 127
int 16 -32768 to 32767
unsigned int 16 0 to 65535
signed int 16 -32768 to 32767
short int 16 -32768 to 32767
unsigned short int 16 0 to 65535
signed short int 16 -32768 to 32767
long int 32 -2147483648 to 2147483647
unsigned long int 32 0 to 4294967295
signed long int 32 -2147483648 to 2147483647
float 32 3.4E-38 to 3.4E+38
double 64 1.7E-308 to 1.7E+308
long double 64 1/7E-308 to 1.7E+308
Keywords
Keywords in C are reserved words that have a special meaning. Reserved words "reserved" by the programming language for expressing various statements and constructs. thus, these may not be redefined by the programmer (LIM99).
auto double int struct
break else long switch
case enum register typedef
char extern return union
const float short unsigned
continue for signed void
default goto sizeof volatile
do if static while
VARIABLES, CONSTANTS, OPERATORS, AND EXPRESSIONS Identifiers Defined
Identifiers are composed of a sequence of letters, digits, and the special character_(underscore). Avoid using names that are too short or too long. Limit the identifiers from 8 15 characters only (LIM99).
Variables Defined
Variables are identifiers that can store a changeable value. These can be different data types (LIM99).
Rules for defining or naming identifiers/variables
1. It must consist only of letters, digits, and underscore.
Example: _duh, num_1(correct)
2. It should not begin with a digit.
Example: 1name, 3to3 (incorrect)
3. An identifier defined in the C standard library should not be redefined.
Example: printf, scanf (incorrect)
4. It is case sensitive; meaning uppercase is not equal to the lowercase.
Example: ans ≠ Ans ≠ aNs or anS or ANs or ANS
5. Do not include embedded blanks.
Example: large num (incorrect)
6. Do not use of the C-language keywords as your variable / idetifier.
7. Do not call your variable / identifier by the same name as other functions.
Variable Declaration
All variables must be declared before they may be used. The general form of declaration is shown here:
Type variable list;
Example: int i, j, k;
short i, j, k;
Note: Before declaring variable, specify first the data type of the variable/s
Variable must be separated by comma
All declarations must be terminated by a semicolon (;)
Local Variables
"Variables that are declared inside a function are called local variables. It can only be referenced by statements that are inside the block in which the variable are declared" (SARR97).
Example:
#include <stdio.h>
main()
{
int a,b,c; (these are local variables)
_________;
_________;
_________;
Global Variables
"Global Variable are know throughout the entire program and may be used by any piece of code. Global variables are created by declaring them outside of any function" (SARR97).
Example:
#include <stdio.h>
int a,b,c, (these are global variables
main()
{
_____________;
_____________;
_____________;
}
Constants Defined
Constants are identifiers / variables that can store a value that cannot be changed during program execution(LIM99).
Example: const int count =100;
Where integer count has a fixed value of 100
Arithmetic, Logical, Relational, and Bitwise Operators
"Operator is a symbol that tells the compiler to perform specific mathematical or logical manipulations. There are three classes of operators in C: arithmetic, logical and relational, and bitwise" (SARR97).
Arithmetic Operators
Operator Action
+ Addition
- Subtraction
* Multiplication
/ Division
% Modulus Divisor
-- Decrement a value
++ Increment a value
Relational and logical Operators
"In the term relational operator, the word relational refers to the relationship values can have with one another. In the term logical operator, the word logical refers to the ways these relationships can be connected together using the rules of formal logic. The key to the concept of relational and logical operators is the idea of true or false" (SCHI92).
Relational Operators
Operator Action
> Greater than
>= Greater than or equal to
< Less than
<= Less than or equal to
== Equal
!= Not equal
Logical Operators
Operator Action Truth Table
&& AND true && true = true
true && false = false
false && true = false
false && false =false
ll OR true II true = true
true II false = true
false II true = true
false II false = false
! NOT ! true = false
! false = true
Bitwise Operator
"Bitwise operations are the testing, setting or shifting of the actual bits in a byte or a word, which corresponds to C's standard char and int data types and variants. Bitwise operators cannot be used on type float, double, long double, void or other more complex types" (SCHI92).
Operator Action
& AND
I OR
^ Exclusive OR (XOR)
~ One's complement
>> Shift right
<< Shift left
The ? Operator
"? Operator is a very powerful and convenient operator that can be used to replace certain statements of the if-then-else form" (SCHI92).
Example: y=x>9?100:200
is equivalent to
if (x>9)
y=100;
else
y=200;
Evaluation of Expression
Expression refers to anything that evaluates to a numeric value (LIM99).
Order Precedence
( ) Highest
!,unary+,-
*,/,%
binary+,-
<, <=, >, >=
==, !=
&&
II Lowest
Examples:
A. Evaluate the following:
1. Given: z=5; a=3; b=9; w=2; y=-5
Converting Mathematical Formula to C Expression
"To solve mathematical problems using the computer, the formula should be translated to the programming language to be used. Arithmetic comutation should be written as C expressions" (LIM99).
Example:
x and y are greater than z can be converted to z=x>z&&y>z
x is equal to 1.0 or 3.0 can be converted to x == 1.0 II x== 3
when developing applications for the PC. Borland followed up that success by releasing Turbo Basic, Turbo Prolog andTurbo C.Turbo C had the same properties as Turbo Pascal: an integrated development environment (IDE), a fast compiler, a goodeditor and all that for a cheap price. Nevertheless, Turbo C was not as successful as the Pascal-sister product. First, Cwas not a school language such as Pascal, but rather a language for professional programming and systemsdevelopment. Turbo C was therefore competing with a full field of professional programming tools (Microsoft C, LatticeC, Watcom C, etc.). Turbo C did, however, have advantages in speed of compiled code, the ability for large projects to beimplemented, and compared to competing compilers a very low price.
Version history
Version 1.0
, on May 13, 1987 - It offered the firstintegrated edit-compile-run development environmentfor C on IBM PCs. The software was, like manyBorland products of the time, bought from another company and branded with the "Turbo" name, in this case
Wizard C
by Bob Jervis (The flagship Borlandproduct at that time, Turbo Pascal, which at this timedid not have pull-down menus, would be given a faceliftwith version 4 released late in 1987 to make it look more likeTurbo C.) It ran in 384 kB of memory. It allowed inlineassembly with full access to C symbolic names andstructures, supported all memory models, and offeredoptimizations for speed, size, constant folding, and jumpelimination.
Version 1.5
, in January 1988 - This was anincremental improvement over version 1.0. It included moresample programs, improved manuals and other bug fixes. Itwas shipped on five 360 KB diskettes of uncompressed files, and came with sample C programs, including a strippeddown spreadsheet called mcalc. This version introduced the <conio.h> header file (which provided fast, PC-specificconsole I/O routines). (Note: The copyright date in thestartup screen is 1987, but the files in the systemdistribution were created in January 1988.)
Version 2.0
, in 1989 - The American release was in late1988, and featured the first "blue screen" version, whichwould be typical of all future Borland releases for MS-DOS. The American release did not have Turbo Assembler or a separate debugger. (These were beingsold separately as the product Turbo Assembler.)See this ad for details: Turbo C, Asm, and Debugger were sold together as a professional suite of tools.
http://www.scribd.com/doc/62396755/The-History-of-Turbo-C
Some examples of the uses of C are: -Operating System
-Language Compliers
-Assemblers
-Text Editors
-Print Spoolers
-Network Devices
-Modem programs
-Databases
-Language Interpreters
-Utilities Features of C Language -A simple core language, such as math functions or file handling provided by a standard set of library routines.
-Focus on procedural programming paradigm which facilitates for programming in a structured style.
-Parameters are always passed by value, never by reference.
-C is flexible when it allows unrestricted conversion of data from one type to another, such as conversion of a character to its numeric equivalent. CHAPTER 1: FLOWCHARTING AND ALGORITHMS 1.1 Flowchart Defined
-"Use of symbols and phrases to designate the logic of how a problem is solved" (SCHN95).
-"A common method for defining the logical steps of flow within a program by using a series of symbols to identify the basic Input, Process and Output (IPO's) function within a program" (TRA196).
-"A two-dimensional representation of an algorithm; the predefined graphic symbols of a flowchart are used to indicate the various operations and the flow of control" (SWAZ89).
-"A diagram representing the logical sequence in which a combination of steps or operations is to be performed. It is a blueprint of the program" (LAPU86).
1.2 Algorithm Defined
-"Algorithm is a finite set of instructions that can specify a sequence of operations to be carried out in order to solve a specific problem of class of problems" (SWAZ89).
Terminal Symbol
Used to signify the beginning and end of flowchart Preparation or Initialization Symbol Signifies the preparation of data
Used to select initial conditions
Used to represent instructions or group of instructions that will alter or modify a program's course of execution. Input / Output "Shows input and output. Data are to be read into the computer memory from an input device or data are to be passed from the memory to an output device" (SWAZ89) Processing
Performs any calculations that are to be done Decision Signifies any decision that are to be done
"Two alternative execution paths are possible. The path to be followed is selected during the execution by testing whether or not the condition specified within the outline is fulfilled" (SWAZ89) On-page Connector "Shows the entry or exit point of the flowchart" (SWAZ89)
"A non-processing symbol used to connect one part of a flowchart to another without drawing flowlines" (LAU86).
"Conserves space by keeping related blocks near one another, reduces the number of flowlines in complex programs, and eliminates cros lines from taking place" (LAPU86). Off-page Connector "Designates entry to or exit from one page when a flowchart requires more than one page" (LAPU86) Flowlines Signifies the process that is to be executed next Turbo C Environment Four Parts of Turbo C Environment
1. Main menu
2. Editor status line and edit window
3. Compiler message window
4. "Hot key" quick reference line Turbo C`s Main Menu
The main menu is used to choose an instructions for the Turbo C what to do.
There are two ways of selecting the main menu, First, by arrow key to move and
highlight the selected menu and followed by pressing the enter button. Second,
by simply hitting the alt key + the desired menu to select.
Example: alt + F for file or alt + P for project.
Menu item with its description:
File - Loads and save files,invokes DOS, and handles directories.
Edit - Invokes the Turbo C Editor.
Run - Compiles, links and runs the program currently loaded in the work area.
Compile - Compiles the program currently in the work area.
Project - Manges multi-file projects.
Options - Sets various compiler, linker, and the environment options.
Debug - Sets various debug options.
Break/watch - Manages debugger watch expressions and break points
Note: if some of the info above are wrong kindly take time to comment for revising the entry.
Submenus under File menu (SCH192)
a. Load-enables the user to select a file to be opened or loaded into the editor.
b. Pick-enables the user to select a file based on the nine files previously opened or edited.
c. New-lets the user edit a new file or start new programs.
d. Save-store or "saves the file currently in the editor" (SCH192).
e. Write to-enables the user to "save a file using a different filename" (SCH192).
g. Change dir-enables the user to specify the defined path to change the default path or directory.
h. OS Shell-"loads the DOS command processor" and lets the user "execute DOS command processor" and lets the user "execute DOS commands" (SCH192).
i. Quit-lets the user to exit or quit Turbo C. Turbo C Language Hot Keys
Hot Keys
F1 - Online help
F2 - Saves the current file being edited
F3 - Loads a file
F5 - Zooms the window
F6 - Switches between the window
F7 - Trace
F8 - Step
F9 - Compiles and links your program
F10 - Toggles between the main menu and the editor
Alt-F1 – last help screen
Alt-F3 – allows you to pick a file to load
Alt-F5 – switches between environment screen and output screen
Alt-F7 – previous error
Alt-F8 – next error
Alt-F9 – compiles file to .OBJ
Alt-C – Compile menu
Alt-D – Debug menu
Alt-E – Edit menu
Alt-F – File Menu
Alt-O – Option Menu
Alt-P – Program Menu
Alt-R – Run Menu
Alt-X – Quits Turbo C
Ctrl-F1 – requests help about the item which contains in the cursor
Ctrl-F9 – Runs the program
Data Types for Turbo C
Data Types
There are five elementary data types in C: characters (char), integer (int), floating point, double floating point and void. "Values of type char are used to hold ASCII characters or any 8-bit quantity. Variables of type int are used to hold integer quantities. Values of type float and double are used to hold real numbers. Real numbers have both an integer and fractional component. The type void has three uses: The first is to declare explicitly a function as having no parameters. The third is to create generic pointers" (SCHI92).
Type Bidwidth Range
char 8 0 to 255
int 16 -32768 to 32767
float 32 3.4E-38 to 3.4E+38
double 64 1.7E-308 to 1.7E+308
void 0 valueless
Size and Range of Turbo C's Basic Data Types
Type Modifiers
Except type void, the basic data types may have various modifiers preceding them. "A modifier is used to alter the meaning of the base type to fit the needs of various situations more precisely. The list of modifiers includes the following" (SCHI92:
signed
unsigned
long
short
Type Bidwidth Range
char 8 -128 to 127
unsigned char 8 0 to 255
signed char 8 -128 to 127
int 16 -32768 to 32767
unsigned int 16 0 to 65535
signed int 16 -32768 to 32767
short int 16 -32768 to 32767
unsigned short int 16 0 to 65535
signed short int 16 -32768 to 32767
long int 32 -2147483648 to 2147483647
unsigned long int 32 0 to 4294967295
signed long int 32 -2147483648 to 2147483647
float 32 3.4E-38 to 3.4E+38
double 64 1.7E-308 to 1.7E+308
long double 64 1/7E-308 to 1.7E+308
Keywords
Keywords in C are reserved words that have a special meaning. Reserved words "reserved" by the programming language for expressing various statements and constructs. thus, these may not be redefined by the programmer (LIM99).
auto double int struct
break else long switch
case enum register typedef
char extern return union
const float short unsigned
continue for signed void
default goto sizeof volatile
do if static while
VARIABLES, CONSTANTS, OPERATORS, AND EXPRESSIONS Identifiers Defined
Identifiers are composed of a sequence of letters, digits, and the special character_(underscore). Avoid using names that are too short or too long. Limit the identifiers from 8 15 characters only (LIM99).
Variables Defined
Variables are identifiers that can store a changeable value. These can be different data types (LIM99).
Rules for defining or naming identifiers/variables
1. It must consist only of letters, digits, and underscore.
Example: _duh, num_1(correct)
2. It should not begin with a digit.
Example: 1name, 3to3 (incorrect)
3. An identifier defined in the C standard library should not be redefined.
Example: printf, scanf (incorrect)
4. It is case sensitive; meaning uppercase is not equal to the lowercase.
Example: ans ≠ Ans ≠ aNs or anS or ANs or ANS
5. Do not include embedded blanks.
Example: large num (incorrect)
6. Do not use of the C-language keywords as your variable / idetifier.
7. Do not call your variable / identifier by the same name as other functions.
Variable Declaration
All variables must be declared before they may be used. The general form of declaration is shown here:
Type variable list;
Example: int i, j, k;
short i, j, k;
Note: Before declaring variable, specify first the data type of the variable/s
Variable must be separated by comma
All declarations must be terminated by a semicolon (;)
Local Variables
"Variables that are declared inside a function are called local variables. It can only be referenced by statements that are inside the block in which the variable are declared" (SARR97).
Example:
#include <stdio.h>
main()
{
int a,b,c; (these are local variables)
_________;
_________;
_________;
Global Variables
"Global Variable are know throughout the entire program and may be used by any piece of code. Global variables are created by declaring them outside of any function" (SARR97).
Example:
#include <stdio.h>
int a,b,c, (these are global variables
main()
{
_____________;
_____________;
_____________;
}
Constants Defined
Constants are identifiers / variables that can store a value that cannot be changed during program execution(LIM99).
Example: const int count =100;
Where integer count has a fixed value of 100
Arithmetic, Logical, Relational, and Bitwise Operators
"Operator is a symbol that tells the compiler to perform specific mathematical or logical manipulations. There are three classes of operators in C: arithmetic, logical and relational, and bitwise" (SARR97).
Arithmetic Operators
Operator Action
+ Addition
- Subtraction
* Multiplication
/ Division
% Modulus Divisor
-- Decrement a value
++ Increment a value
Relational and logical Operators
"In the term relational operator, the word relational refers to the relationship values can have with one another. In the term logical operator, the word logical refers to the ways these relationships can be connected together using the rules of formal logic. The key to the concept of relational and logical operators is the idea of true or false" (SCHI92).
Relational Operators
Operator Action
> Greater than
>= Greater than or equal to
< Less than
<= Less than or equal to
== Equal
!= Not equal
Logical Operators
Operator Action Truth Table
&& AND true && true = true
true && false = false
false && true = false
false && false =false
ll OR true II true = true
true II false = true
false II true = true
false II false = false
! NOT ! true = false
! false = true
Bitwise Operator
"Bitwise operations are the testing, setting or shifting of the actual bits in a byte or a word, which corresponds to C's standard char and int data types and variants. Bitwise operators cannot be used on type float, double, long double, void or other more complex types" (SCHI92).
Operator Action
& AND
I OR
^ Exclusive OR (XOR)
~ One's complement
>> Shift right
<< Shift left
The ? Operator
"? Operator is a very powerful and convenient operator that can be used to replace certain statements of the if-then-else form" (SCHI92).
Example: y=x>9?100:200
is equivalent to
if (x>9)
y=100;
else
y=200;
Evaluation of Expression
Expression refers to anything that evaluates to a numeric value (LIM99).
Order Precedence
( ) Highest
!,unary+,-
*,/,%
binary+,-
<, <=, >, >=
==, !=
&&
II Lowest
Examples:
A. Evaluate the following:
1. Given: z=5; a=3; b=9; w=2; y=-5
Converting Mathematical Formula to C Expression
"To solve mathematical problems using the computer, the formula should be translated to the programming language to be used. Arithmetic comutation should be written as C expressions" (LIM99).
Example:
x and y are greater than z can be converted to z=x>z&&y>z
x is equal to 1.0 or 3.0 can be converted to x == 1.0 II x== 3