0% found this document useful (0 votes)
2 views

c Programming-chapter 01

C is a general-purpose, structured programming language known for its efficiency, portability, and ability to extend itself. A C program consists of six main sections: documentation, link, definition, global declaration, main function, and sub-program sections. C is widely used for developing system applications, operating systems, and various software, and was developed by Dennis Ritchie in 1972.

Uploaded by

flxv07
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

c Programming-chapter 01

C is a general-purpose, structured programming language known for its efficiency, portability, and ability to extend itself. A C program consists of six main sections: documentation, link, definition, global declaration, main function, and sub-program sections. C is widely used for developing system applications, operating systems, and various software, and was developed by Dennis Ritchie in 1972.

Uploaded by

flxv07
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 14

WELCOME

PRESENTED BY
SHEYONA G
CHAPTER-01
Overview of C
What is C Programming
Langauge?
• C is a general-purpose programming language

• It is a structured programming language

• C are efficient and fast.

• C is highly portable i.e, C programs written for one computer can be run on another
with little or no modification.
• C has the ability to extend itself.

• It is machine-independent and is used to write various applications, Operating


Systems like Windows, and many other complex programs like Oracle database,
Git, Python interpreter, and more.
Basic structure of C program
A C program contains mainly six sections.
They are,
1. Documentation Section:
This section consists of a set of comment lines means we can give name of the program, author name
and other details.
Ex: // Addition of two numbers /* Printing numbers from 1 to 100 */

2. Link section:
This section provides instruction to the compiler to link function from system library.
Ex: #include #include
3. Definition section:
Definition section defines all symbolic constants
Ex: #define AMOUNT 1000

4. Global declaration section


There are some variables that are used in more than one function. Such variables are called global
variables and are declared in global declaration section. In this section we can declare all the user-defined
functions also.
Ex: int a,b,c main() { ………. }
5. Main() function section:
A C program must have one main() function section. Each and every program start executes from main()
function. This section contains two parts. They are,

a. Declaration part
b. Executable part

The declaration part declares all the variables used in executable part.
These two parts must appear between the opening and closing braces.
The program execution begins at the opening brace and ends at the closing brace.
All statements in the declaration and executable parts end with a semicolon (;).
6. Sub-program section:
 The sub-program section contains all the user-defined functions that are called in the main function,
 User-defined functions are generally placed immediately after the main() function although they appear in any
order.
 All sections, except main() function section may be absent when they are not required.
Application Of C
 'C' language is used for developing system applications.
 It is used for developing desktop applications.
 Most of the applications by Adobe are developed using 'C' programming language.
 It is used for developing browsers and their extensions.
 It is used to develop databases.
 MySQL is the most popular database software is built using 'C'.
 It is used in developing an operating system.
 It is used for developing desktop as well as mobile phone's operating system.
 It is used for compiler production.
 It is widely used in IOT applications.
SAMPLE C PROGRAM
EXECUTION OF C PROGRAM IN Turbo C

Step 1 : Open turbo C IDE(Integrated Development Environment), click on File and then click on New
Step 2 : Write the above example as it is
Step 3 : Click on compile or press Alt+f9 to compile the code
Step 4 : Click on Run or press Ctrl+f9 to run the code
Step 5 : Now go to compile and click on Compile. And then Click on Run. You will see the output of your C program.
Summary
 'C' was developed by Dennis Ritchie in 1972.
 It is a robust language.
 It is a low programming level language close to machine language
 It is widely used in the software development field.
 It is a procedure and structure oriented language.
 It has the full support of various operating systems and hardware platforms.
 Many compilers are available for executing programs written in 'C'.
 A compiler compiles the source file and generates an object file.
 A linker links all the object files together and creates one executable file.
 It is highly portable.
ASSIGNMENT QUESTIONS

1. List out any 4 features of C language


2. Write a C program to display the message HelloWorld
3. Briefly explain the basic structure of C program.
4. Write a C program to find sum of two numbers.
5. What do you mean by documentation section?
6. What do you mean by definition section?
7. What do you mean by link section?

You might also like