You are on page 1of 30

PROGRAMMING 1

WEEK – 2 TO WEEK 3
WHAT IS PROGRAMMING LANGUAGE

• A programming language is an artificial language that can be used to


control the behavior of a machine, particularly a computer.
• Programming languages, like human languages, are defined through the use
of syntactic and semantic rules, to determine structure and meaning
respectively.
EXAMPLE OF PROGRAMMING LANGUAGE

• JAVA
• RUBY
• PYTHON
• PEARL
•C
WHAT IS C LANGUAGE

• C is a general-purpose, high-level language that was


originally developed by Dennis M. Ritchie
• Dennis Ritchie is known as the founder of the c
language.
• C language was developed to be used in UNIX
operating system
• C Language is founder of many computer languages
• Unix OS and all compilers and essentially Unix
application is written by C Language.
EXAMPLE OF COMPUTER LANGUAGE
REASON WHY C LANGUAGE IS USED BY
PROFESSIONAL

• Easy to learn
• Structured language
• It produces efficient programs
• It can handle low-level activities
• It can be compiled on a variety of computer platforms – Middle-Level-
Language
FACTS ABOUT C LANGUAGE
• C was invented to write an operating system called UNIX.
• C is a successor of B language which was introduced around the early 1970s.
• The language was formalized in 1988 by the American National Standard
Institute (ANSI).
• The UNIX OS was totally written in C.
• Today C is the most widely used and popular System Programming Language.
• Most of the state-of-the-art software have been implemented using C.
• Today's most popular Linux OS and RDBMS MySQL have been written in C
EXAMPLE OF USES OF C LANGUAGE
• Operating Systems
• Language Compilers
• Assemblers
• Text Editors
• Print Spoolers
• Network Drivers
• Modern Programs
• Databases
• Language Interpreters
• Utilities
ADVANTAGE OF C LANGUAGE
• C is a small language, yet powerful - It has only 32 keywords (or reserved
words), which are the commands that make up the C Language.
• C is the native language of UNIX - C is the standard development language
for personal computers, Most Windows applications, database programs,
graphics libraries, and other large application are written in C.
• C code is very portable
ABOUT C LANGUAGE
• C is capable of running on more than one computer system or under more
than one OS.
• Easily transfer application programs written in C from one system to another
• C is portable mainly because the actual language definition is very small.
• The C language does not even have built-in routines for printing to the screen
or reading from the keyboard.
ABOUT C LANGUAGE
• C is portable mainly because the actual language definition is very small.
• C programs use a standard library that works the same in all machines.
• C is the foundation for C++ and Java.
• C is a small language, yet powerful
WHAT IS TURBO C

• Turbo C is a particular version of C developed by Borland International


Corporation in 1987
• Turbo C is designed to run on various microcomputer systems
• Turbo C provides both an integrated development environment (IDE)
• The Turbo C Editor is used to create a C program called the source code
REQUIREMENT TO INSTALL TURBO C
ADVANTAGE OF TURBO C

• Extended C Language
• Compiler
• Debugger
• Run-Time Environment
• User Interface.
HOW TO USE TURBO C

• Using the Turbo C IDE


STARTING AND QUITTING TURBO C
• Find TC.EXE among your programs. You can right click on start  explore
(or search) to explore/search the drive and directory (or folder) where Turbo
C is installed.
• Run the Turbo C program by double-clicking on TC or TC.EXE
• When Turbo C begins and waits at the Copyright screen, press, Enter
• The main Turbo C appears
• Use arrow keys to highlight the item, then press Enter; or  Type the first letter of the
menu item you want (e.g, press E or e to select the Edit
EXAMPLE
PROGRAM STRUCTURE

• Headers - C programs where libraries are included in the compilation process


and where macros to be defined are written and stated. It may contain the
following:

• Preprocessor. A system program that modifies a C program prior to its compilation.


• Preprocessor directive. A C program line beginning with # that provides an instruction to
the preprocessor.
THE TWO MOST COMMONLY USE
DIRECTIVES ARE
• #include- for libraries used in the program
• #define- for constant macro definition.

• A constant macro is a name that is replaced by a particular constant value before the program is
sent to the compiler.

• Example
#define pi_value 3.1416
COMMONLY USED INCLUDE FILES IN C
LANGUAGE
C PROGRAM STRUCTURE

• Declaration
• Functions
• Comments
• Identifiers
• Reserved words
IMPORTANCE OF COMMENTS ON
PROGRAMS

• Program documentation contains information that enhances the readability of


the program.
• Comments are part of program documentation because they help others read
and understand the program. The compiler, however, ignores comments and
they are not translated into machine language.
TYPES OF COMMENTS:

• Multiple line comments – are comments enclosed by /* and */.


• Single line comments – are comments placed after // symbols.
IDENTIFIERS

• Identifiers are names given to various program elements, such as variables,


functions and arrays. The following are the guidelines in creating identifiers:
RESERVED WORDS

• Reserved words are keywords that have standard predefined meaning in C.


These reserved words can be used only for intended purpose and they cannot
be used as programmer’s defined identifiers
THANK YOU!
ACTIVITY

• Install the Turbo C


• Print the basic “Hello World!” using the Turbo C Compiler

Submission will be November 14, 2021 – 10:00 AM


Send the Screen shot to
Jmmaghari29@gmail.com

You might also like