Showing posts with label C character set. Show all posts
Showing posts with label C character set. Show all posts

Saturday, May 17, 2008

How to open C program code window

How to open C program code window

Before opening C on your computer. Please ensure that C compiler has been loaded or not. If not then please load it first and then try any of the following ways to open C which suit your computer setting.

1.Start>>Program >> Turbo c.

2. If turbo C icon is present on your computer desktop then simply click on it.

3. My computer >>c:\>> tc (folder)>> bin (folder) >> tc.exe (icon).

4. Or make sure the path where you have loaded the C on your computer and try to run it from there.

Description of C code window


Description of C code window

1. =: Interface to external programs.

2. File: File related option such as opening and saving file.

3. Edit: Cut,Copy,Paste operation.

4. Search: Find,Find & Replace operation.

5. Run: Compile and run the file currently loaded in the text editor. And debugging such as setting/clearing trace points can be performed from this menu.

6. Compile: The menu item compiles a source file to an object file or an .exe file.

7. Debug: Provides interactive debugging. Variables can be examined/set/cleared, and we can watch variables change during execution.

8. Project: This menu item controls Borland C++'s handling of large programs that are in multiple source file.

9. Option: Default option are set during installation . The user can change any option at any time through this menu.

10. Windows: Windows operation include zoom, arranging windows on the screen , and closing windows.

11. Help: Borland C++ includes a context sensitive help capability. Select Help or press f1 for general Help, Shift f1 for indexed help or Ctrl f1 for context sensitive help.

The components of C language

The components of C language

There are five main component of C language are:

1. The character set: Any alphabet ,digit or special symbol ,used to represent information is denoted by character. The character in C are grouped into four categories.

1 Letters A...Z and a...z
2 Digits 0,1,2,.....9
3 Special Symbol ~,`,!,@,#,$,%,^,&,*,(),.,<,>,?,/,",:,;,{},[]
4 White Space blank space, Carriage return, form feed, newline, horizontal tab

2. The data types: The power of the programming language depends, among other thing, on the range of different types of data it can handle.

3. Constants: A constant is a fix value that doesn't change while program execution.

4. Variable: A variable is an entity whose value can change during program execution.

5. Keywords: Keywords are those word which have been assigned specific meaning in C language. Keywords should not be used as variable names to avoid problem.

Note: Above given all the term has been discussed in details in next section.

Structure of C Program

Structure of C Program

Every C program is made of function and every function consist of instructions called statement.

Structure of C Program.

#include //stdio.h is the header file
main() // main function is the first function which is executed by a C program.

All C statements are written within main function.
{

// All C statements.

}

Functions

Every C program consists of one or more modules called functions. One of the functions must be called main( ).
The program will always begin by executing the main function, which may access other functions.

Any other function definitions must be defined separately, either ahead of or after main.

A function name is always followed by a pair of parenthesis, namely, ( ). And all function statements are enclosed within a pair of braces { }.

The program execution always starts with main function. When the closing brace of the main function is reached, program execution stops, and the control is handed back to the OS (Operating System).

Statements

Single C language instruction is called a statement. Statements are written according to the grammar of C language. Every C language statement must ends with semicolon(;).

In order to write a C program we should follow some basic rules which are described below:

a) Usually all statements in C are entered in small alphabets.

b) Blank spaces may be inserted between two words to improve the program readability. However no blank spaces are allowed within a variables, constants or key words.

c) It has no specific rules for the position at which statements is to be retained that's why it’s often called a free form language.

d) All C statements must end with a semicolon (; )

Till now, We have very little knowledge about the type of variables, constants and key words. Now we would try to understand the simple C program.

Read this artical regarding C -
1.Introduction(C character set, identifiers, and keywords, data types, )
2.The C character set
3.Key words In C
4.Introduction(Data types)
5.Primary Data Type
6.Secondary Data Type
7.Introduction(Variable)

Introduction(C character set, identifiers, and keywords, data types, )

Introduction


C language consists of some basic elements which are used to construct simple C statements.

These elements include the C character set, identifiers, and keywords, data types, constants, variables and arrays, declaration, expressions and statements.

We will see how these basic elements can be combined to form more comprehensive program components.

Copyright

Copyright © 2008 C Tutorial, All rights are reserved