PROGRAMMING AND DATA STRUCTURES
Programming in C; Functions, Recursion, Parameter passing, Scope, Binding; Abstract
data types, Arrays, Stacks, Queues, Linked Lists, Trees, Binary search trees, Binary
heaps.
Programming in C
C is a computer programming language developed by Dennis Ritchie in 1972 at Bell Laboratories. C is an ANSI/ISO standard and powerful programming language for developing real time applications. C is most widely used language. All other programming languages were derived (directly or indirectly) from C programming concepts.
Features of C:
Programming in C; Functions, Recursion, Parameter passing, Scope, Binding; Abstract
data types, Arrays, Stacks, Queues, Linked Lists, Trees, Binary search trees, Binary
heaps.
Programming in C
C is a computer programming language developed by Dennis Ritchie in 1972 at Bell Laboratories. C is an ANSI/ISO standard and powerful programming language for developing real time applications. C is most widely used language. All other programming languages were derived (directly or indirectly) from C programming concepts.
Features of C:
- Program written in C was efficient and fast, due to variety of date types and powerful operators.
- Modular language, each module is designed to perform its specific function.
- Its data types and control structures allow the development of well-structured programmes.
- C compiler combines the capabilities of an assembly language with features of a high-level language.
- We can also create our own function and add it to C library.
Structure of a C programme
C programme has the following sections
- Preprocessor directives
- Global variable declarations
- Functions
The first line of C programme is #include<stdio.h> tells the computer to include information about standard I/O library. This is known as preprocessor directives.
Every programme has a special function called main(). The execution of any programme starts at the beginning of its main function. The parentheses are used to passing the parameters to function. If required, the variables declarations and statements are added.
Every programme has a special function called main(). The execution of any programme starts at the beginning of its main function. The parentheses are used to passing the parameters to function. If required, the variables declarations and statements are added.
example:
#include<stdio.h>
int main(void)
{
printf("sample programme");\*a call to standard library function*/
}
Variable:
Variable:
- In programming language variables are used to store the information to be used by programs.
- It is also state as a variable is nothing but a name given to a storage area that our programs can manipulate.
- The range of values that can be stored within that memory and the set of operations can be applied to the variable.
Data Types:-
- Data types are declarations for memory location or variables.
- set of data with having predefined characteristics such as integers and characters.
Flow Control Statements
- Individual Statement or group of statements used to determines the sequence of execution of other statements.
- Two types of control structures
- Branching(to decide what action to take)
- looping(how many times to take a certain action)