Rules for Flowcharts
1.Flowchart can have only one start symbol
2.Flowchart can have only one stop symbol
3.Flowchart starts with start symbol and ends with stop symbol
4.General flow of processes is top to bottom
5.Arrows should not cross each other
6.Condition Box [ Diamond Shape ] must have one Input and maximum two Output
PDF below:
BCA_Sem1_DSC-C-111T Elements of Prog.& CO
C programing
A) DSC-C-BCA-111T Elements of Programming & Computer Organization [EPCO]
B) DSC-C-BCA-112P C Programming Practical
C Language:
C is a general-purpose programming language created by Dennis Ritchie at the Bell Laboratories in 1972.
It is a very popular language, despite being old.
C is strongly associated with UNIX, as it was developed to write the UNIX operating system.
C is one of the oldest languages that cannot be replaced by any other language.
hat are the Most Important Features of C Language?
1.C is Procedural Language
2.C is ast and Efficient
3.Modular Approach
4.Statically Type language
5.General-Purpose Language
6.C contains Rich set of built-in Operators
7.Libraries with Rich Functions
8.C is called Middle-Level Language
9.C is portable language
10.Easy to Extend
1. C is Procedural Language
In a procedural language like C step by step, predefined instructions are carried out. C program may contain more than one function to perform a particular task. New people to programming will think that this is the only way a particular programming language works. There are other programming paradigms as well in the programming world. Most of the commonly used paradigm is an object-oriented programming language.
2. C is Fast and Efficient
Newer languages like Java, python offer more features than c programming language but due to additional processing in these languages, their performance rate gets down effectively. C programming language as the middle-level language provides programmers access to direct manipulation with the computer hardware but higher-level languages do not allow this. That’s one of the reasons C language is considered the first choice to start learning programming languages. It’s fast because statically typed languages are faster than dynamically typed languages.
3. Modular Approach
The concept of storing C programming language code in the form of libraries for further future uses is known as modularity. This programming language can do very little on its own most of its power is held by its libraries. C language has its own library to solve common problems.
4. Statically Typed language
C programming language is a statically typed language. Meaning the type of variable is checked at the time of compilation but not at run time. This means each time a programmer types a program they have to mention the type of variables used.
5. General-Purpose Language
From system programming to photo editing software, the C programming language is used in various applications. Some of the common applications where it’s used are as follows:
Operating systems: Windows, Linux, iOS, Android, OXS
Databases: PostgreSQL, Oracle, MySQL, MS SQL Server, etc.
6. C contains Rich set of built-in Operators
It is a diversified language with a rich set of built-in operators which are used in writing complex or simplified C programs.
7. Libraries with Rich Functions
Robust libraries and functions in C help even a beginner coder to code with ease.
8. C is called Middle-Level Language
As it is a middle-level language so it has the combined form of both capabilities of assembly language and features of the high-level language.
9. C is portable language
C language is lavishly portable as programs that are written in C language can run and compile on any system with either no or small changes.
10. Easy to Extend
Programs written in C language can be extended means when a program is already written in it then some more features and operations can be added to it.
ASCII: American Standard Code for Information Interchange
BIT: 0/1
Byte: collection of 8 Bits.
KB: Kilo Byte [ 1024 Bytes ]
MB: Mega Bytes [ 1024 KB ] [ 1048576 Bytes ]
GB: Giga Bytes [ 1024 MB ]
TB: Tera Bytes [ 1024 GB ]
Introduction to Programming Languages:
Low-Level Language (Machine Language)
Low-Level language is the only language which can be understood by the computer. Binary Language is an example of a low-level language. Low-level language is also known as Machine Language. The binary language contains only two symbols 1 & 0. As the CPU directly understands the binary language instructions, it does not require any translator. CPU directly starts executing the binary language instructions and takes very less time to execute the instructions as it does not require any translation. Low-level language is considered as the First Generation Language (1GL).
Advantages
1)A computer can easily understand the low-level language.
2)Low-level language instructions are executed directly without any translation.
3)Low-level language instructions require very less time for their execution.
Disadvantages
1)Low-level language instructions are very difficult to use and understand.
2)Low-level language instructions are machine-dependent, that means a program written for a particular machine does not execute on another machine.
3)In low-level language, there is more chance for errors and it is very difficult to find errors, debug and modify.
Middle-Level Language (Assembly Language)
Middle-level language is a computer language in which the instructions are created using symbols such as letters, digits and special characters. Assembly language is an example of middle-level language. In assembly language, we use predefined words called mnemonics. But the computer cannot understand mnemonics, so we use a translator called Assembler to translate mnemonics into binary language. Assembler is a translator which takes assembly code as input and produces machine code as output.
Advantages
1)Writing instructions in a middle-level language is easier than writing instructions in a low-level language.
2)Middle-level language is more readable compared to low-level language.
3)Easy to understand, find errors and modify.
Disadvantages
1)Middle-level language is specific to a particular machine architecture, that means it is machine-dependent.
2)Middle-level language needs to be translated into low-level language.
3)Middle-level language executes slower compared to low-level language.
High-Level Language
A high-level language is a computer language which can be understood by the users. The high-level language is very similar to human languages and has a set of grammar rules that are used to make instructions more easily. Every high-level language needs to be converted into the low-level language to make it understandable by the computer. We use Compiler or interpreter to convert high-level language to low-level language.Languages like COBOL, FORTRAN, BASIC, C, C++, JAVA, etc., are examples of high-level languages.
Advantages
1)Writing instructions in a high-level language is easier.
2)Easy to understand, create programs, find errors and modify.
3)The programs created using high-level language runs on different machines with little change or no change.
Disadvantages
1)High-level language needs to be translated into low-level language.
2)High-level language executes slower compared to middle and low-level languages
What is Procedural Language and Non-Procedural Language
All the instructions must be written in order and the user has to follow. All the instructions are executed one by one. It has a complete procedure that defines what to do and how to do it. All the instructions are written in a specific order to solve a particular problem. Language is very easily understood by a user because all the instructions are written in order.
Examples of Procedural Language
FORTRON( formula translation)
COBOL( common business-oriented language)
C language
basic( Beginners All-Purpose Symbolic Language)
Advantage of Procedural language
1)It is easy to understand
2)It is easier to test and debug
3)It is a well-structured language
4)Single Programs can be written by more than one program by dividing the program up into modules.
5)It consists of a step-by-step procedure that is why it is easily understood by any user.
6)These languages are very flexible.
Disadvantages of Procedural Languages
1)A big disadvantage of procedural language is the inability to reuse the code.
2)The same type of code many times throughout a program can add to the development cost and time of a project.
3)Testing the program is very difficult.
4)debugging is very difficult.
Non-Procedural Languages
In these languages, all the instructions are not written in a specific order. It is also known as a declarative and functional language. The non-procedural language that does not require writing traditional program logic. Users concentrate on defining the input and output rather than the steps of the program.
Examples of non-procedural languages are as follows.
Java
C++
SQL(Structured Query Language)
RGP( report program generator)
Advantages of Non-Procedural Languages
1)When we write large program it is very difficult to write this program in a procedural language because in a procedural language. We write it’s step-by-step and it becomes very messy.
2)In non- procedural language The large program is easy to handle.
3)The nonprocedural language program is written as a different function and modulus that interact with each other.
4)These languages are easy to understand.
5)These languages are used to write large Programs easily.
6)The execution time is very fast.
Disadvantages of Non-Procedural Languages
1)It is difficult to understand.
2)It is not very flexible.
3)For the large program, the code will become very complex
4)The syntax of this language is not very easy.