Programming in c (importance of c)

334 views 10 slides Aug 16, 2021
Slide 1
Slide 1 of 10
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10

About This Presentation

This PPT explains you about the importance of C that is list out the features of C


Slide Content

PROGRAMMING IN C & C++ Subject Code : 18UMAA31 Subject In-charge : Mr.S.Viswanathan

Importance of C Popularity of C is due to many qualities, Robust Language – Means rich set of built-in functions and operators are used. It is efficient and fast – due to its variety of data types and powerful operators. Example: Incrementing a variable from 0 to 15000 take one second

Cont … Highly Portable – Means Program written in one computer can be run on another. Suited for Structured Programming – Makes program debugging, testing and maintenance easier. Ability to Extend itself – Means we can add our own functions to make the program simple.

Basic Structure of C Program DOCUMENTATION SECTION LINK SECTION DEFINITION SECTION GLOBAL DECLARATION SECTION Continue..

Cont … Main() Function Section { } Declaration Part Executable Part Sub Program Section Function 1 Function 2 Function N . . . . . . (User – Defined Functions)

Cont … Documentation Section – Consists of Comment lines for mention the followings, 1) Name of the Program 2) Author of the Program 3) Other needed Details (created date, function name details etc..)

Cont … Link Section – It gives instructions to compiler to link the built in functions from system library. Ex: #include< stdio.h > #include< conio.h > Definition Section – It defines all the symbolic constants. Ex: #define PI 3.14

Cont … Global Declaration Section – Variables that are used in more than one functions are declared in this section. Ex: int a = 10; // Global Variable int add(){ int sub(){ Printf (“% d”,a ); Printf (“% d”,a ); } }

Cont … m ain() Function Section – Every program must have a main function. It consists of two sections, 1) Declaration Part 2) Executable Part Declaration Part – Declares all the needed variables for a program. Executable Part – At least one statement should be in the executable part. Program execution begins at the opening brace({ ) and ends at the closing brace ( } )

Cont … Sub-Program Section – Contains all user-defined functions User-Defined functions are placed after the main() Section.