Presentation is loading. Please wait.

Presentation is loading. Please wait.

C language IT-1 (Batch-A) Name: EnNo: Arshad Muthalif

Similar presentations


Presentation on theme: "C language IT-1 (Batch-A) Name: EnNo: Arshad Muthalif"— Presentation transcript:

1 C language IT-1 (Batch-A) Name: EnNo: Arshad Muthalif 160410116007
Zaheet Batada Karan Bathani

2 Features of c language It is a robust language with rich set of built-in functions and operators that can be used to write any complex program. The C compiler combines the capabilities of an assembly language with features of a high-level language. Programs Written in C are efficient and fast. This is due to its variety of data type and powerful operators. It is many time faster than BASIC. C is highly portable this means that programs once written can be run on another machines with little or no modification. Another important feature of C program, is its ability to extend itself. A C program is basically a collection of functions that are supported by C library. We can also create our own function and add it to C library. C language is the most widely used language in operating systems and embedded system development today.

3

4 Structure of c

5 Documentation section consists of a set of common lines giving the name of the program, the author and other details. Link section provides instructions to the compiler to link functions from the system library. Definition section defines all symbolic constants. Global variable and are declared in the global declaration section. Every c program must have one main() function section. This section consists two parts, declaration part and executable part. User defined functions are generally placed immediately after the main() function. The subprogram section consists of all the user defined functions that are called in the main() functions.

6 The layout of C Programs
The general form of a C program is as follows : pre-processor directives global declarations main() { local variables to function main ; statements associated with function main ; }

7 f1() { local variables to function 1 ; statements associated with function 1 ; } f2() local variables to function f2 ; statements associated with function 2 ; . etc

8  () are used in conjunction with function names whereas {} are used as to delimit the C statements that are associated with that function. A semicolon (;) is used to terminate C statements. C is a free format language and long statements can be continued, without truncation, onto the next line. The semicolon informs the C compiler that the end of the statement has been reached. Free format also means that you can add as many spaces as you like to improve the look of your programs.

9 Data types in C Language
Data types specify how we enter data into our programs and what type of data we enter. C language has some predefined set of data types to handle various kinds of data that we use in our program. These datatypes have different storage capacities. C language supports 2 different type of data types,

10 Primary data types These are fundamental data types in C namely integer(int), floating(float), charater(char) and void. Derived data types Derived data types are like arrays, functions, stuctures and pointers.

11

12 Variables in C Language
A variable is a name that may be used to store a data value. Unlike constant, variables are changeable, we can change value of a variable during execution of a program. A programmer can choose a meaningful variable name. Example : average, height, age, total etc.

13 Rules to define variable name
Variable name must be upto 8 characters. Variable name must not start with a digit. Variable name can consist of alphabets, digits and special symbols like underscore _. Blank or spaces are not allowed in variable name. Keywords are not allowed as variable name.

14 Declaration of variable
Declaration of variables must be done before they are used in the program. Declaration does two things. It tells the compiler what the variable name is. It specifies what type of data the variable will hold.

15 Thank you


Download ppt "C language IT-1 (Batch-A) Name: EnNo: Arshad Muthalif"

Similar presentations


Ads by Google