Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

B.

Sc I Year / II Semester
UNIT – I   ‘C’ Fundamentals, Tokens, Control and Decision Making Statements
I. TYPES OF PROGRAMMING LANGUAGES
The types of programming languages have been dependent on the generation of languages.
Like generation of computers there is a generation of languages, they are as follows:
a) First-Generation Languages
b) Second-Generation Languages
c) Third-Generation Languages
d) Fourth-Generation Languages
e) Fifth-Generation Languages

a) First-Generation Languages: In this generation the programming language used was only
the Machine language, which was a binary number system code (i.e. is 0’s or 1’s like 00010101
1010101,,,,,,, .)

b) Second-Generation Languages: In this generation the 2 type of programming language was


used, they were machine language and assembly language code. This 2 type of programming
language where low level language, which was little bit difficult to understand by the use, and
writing big code of program was also difficult.

c) Third-Generation Languages: In this generation the programming language used high level
languages, which were used for user for different

BASIC: BASIC (standing for Beginner's All Purpose Symbolic Instruction Code) is a system
developed at Dartmouth College in 1964 under the directory of J. Kemeny and T. Kurtz. It was
implemented for the G.E.225. It was meant to be a very simple language to learn and also one
that would be easy to translate.

C: The third letter of the English alphabet. ASCII 1000011. The name of a programming
language designed by Dennis Ritchie during the early 1970s and immediately used to
reimplement Unix; so called because many features derived from an earlier compiler named `B'
in commemoration of its parent, BCPL. (BCPL was in turn descended from an earlier Algol-
derived language, CPL.) Before Bjarne Stroustrup settled the question by designing C++, there
was a humorous debate over whether C's successor should be named `D' or `P'. C became
immensely popular outside Bell Labs after about 1980 and is now the dominant language in
systems and microcomputer applications programming. See also languages of choice, indent
style.

C is often described, with a mixture of fondness and disdain varying according to the speaker, as
"a language that combines all the elegance and power of assembly language with all the
readability and maintainability of assembly language".

C++: An extension to the C language developed primarily by B.Stroustrup at AT&T Bell


Laboratories: it supports object-oriented programming among other enhancements.

COBOL: COmmon Business Oriented Language. Sometimes referred to as a subset of English,


rather than a programming language.

CHP 1 (INTRODUCTION) Page 1


B.Sc I Year / II Semester
UNIT – I   ‘C’ Fundamentals, Tokens, Control and Decision Making Statements
Java: Java is a general-purpose computer programming language that is concurrent, class-based,
object-oriented, and specifically designed to have as few implementation dependencies as
possible. It is intended to let application developers "write once, run anywhere" (WORA),
meaning that compiled Java code can run on all platforms that support Java without the need for
recompilation. Java applications are typically compiled to bytecode that can run on any Java
virtual machine (JVM) regardless of computer architecture. As of 2015, Java is one of the most
popular programming languages in use, particularly for client-server web applications, with a
reported 9 million developers. Java was originally developed by James Gosling at Sun
Microsystems (which has since been acquired by Oracle Corporation) and released in 1995 as a
core component of Sun Microsystems' Java platform. The language derives much of its syntax
from C and C++, but it has fewer low-level facilities than either of them.

Pascal: PASCAL is a programming language named after the 17th century mathematican Blaise
Pascal. Provides a teaching language that highlights concepts common to all computer
languages. Standardises the language in such a way that it makes programs easy to write
Strict rules make it difficult for the programmer to write bad code!

FORTRAN: FORTRAN stands for Formula Transulation. It is a general-purpose, procedural,


imperative programming language that is especially suited to numeric computation and scientific
computing. Originally developed by IBM in the 1950s for scientific and engineering
applications, Fortran came to dominate this area of programming early on and has been in
continual use for over half a century in computationally intensive areas such as numerical
weather prediction, finite element analysis, computational fluid dynamics (CFD), computational
physics, and computational chemistry.

d) Fourth-Generation Languages: The 4GLs are easier to use than 3GLs. In 4GL visual
environment, the programmer uses a toolbar to drag and drop various items like buttons, labels
and text boxes to create a visual definition of an application. The 4GLs languages include the
following:

.NET: The .NET is MS’s newest entry into the programming arena. It combines several
programming languages into one IDE (Integrated Development Environment). Included are
Visual Basic (VB), C#.

e) Fifth-Generation Languages: The 5GLs are actually something of a mystery. Depending on


which expert you ask, they may or may not even agree that 5GLs exist. Some experts consider
the more advanced authoring environments to be 5GLs, while others do not. In principle, a 5GL
would use artificial intelligence to create software based on your description of what the software
should do.

The 5GLs are as follows:


a. HTML (HyperText Markup Language)
b. XML (Extensible Markup Language)
c. Dreamweaver
d. Flash
e. Scripting Languages

CHP 1 (INTRODUCTION) Page 2


B.Sc I Year / II Semester
UNIT – I   ‘C’ Fundamentals, Tokens, Control and Decision Making Statements
i. Java Script
ii. ASP (Active Server Pages)
iii. PHP (HyperText Preprocessor)
II. ALGORITHMS
An algorithm is an effective method that can be expressed within a finite amount of space
and time and in a well-defined formal language for calculating a function.

Starting from an initial state and initial input (perhaps empty), the instructions describe a
computation that, when executed, proceeds through a finite number of well-defined successive
states, eventually producing "output" and terminating at a final ending state.

The transition from one state to the next is not necessarily deterministic; some algorithms,
known as randomized algorithms, incorporate random input.

Computer science is the scientific and practical approach to computation and its
applications. It is the systematic study of the feasibility, structure, expression, and mechanization
of the methodical procedures (or algorithms) that underlie the acquisition, representation,
processing, storage, communication of, and access to information. An alternate, more succinct
definition of computer science is the study of automating algorithmic processes that scale. A
computer scientist specializes in the theory of computation and the design of computational
systems.

Algorithm types we will consider include:


a) Simple recursive algorithms
b) Backtracking algorithms
c) Divide and conquer algorithms
d) Dynamic programming algorithms
e) Greedy algorithms
f) Branch and bound algorithms
g) Brute force algorithms
h) Randomized algorithms

Algorithm to add two numbers.


1. Start
2. Read the Value of A and B.
3. SUM = A+B.
4. Display SUM.
5. Stop.
Algorithm for Sum of n natural numbers
1. Start
2. Read the value of n.
3. i = 1 , SUM = 0
4. if ( i > n ) go to 7
5. S = S + i

CHP 1 (INTRODUCTION) Page 3


B.Sc I Year / II Semester
UNIT – I   ‘C’ Fundamentals, Tokens, Control and Decision Making Statements
6. i=i+1
7. go to 3
8. Display the value of S
9. Stop

Algorithm for Factorial of n numbers


1. Start
2. Read the value of n.
3. i = 1 , F =1
4. if ( i > n ) go to 7
5. F = F * i
6. i = i + 1
7. go to 3
8. Display the value of S
9. Stop

Algorithm to find the value of xn


1. Start
2. Read the value of n.
3. i=1,m=1
4. If i > n then go to 7
5. m=m*x
6. i=i+1
7. go to 3
8. Display m
9. Stop

III. FLOW CHARTS


A flowchart is a type of diagram that represents an algorithm, workflow or process,
showing the steps as boxes of various kinds, and their order by connecting them with arrows.

This diagrammatic representation illustrates a solution model to a given problem. Flowcharts are
used in analyzing, designing, documenting or managing a process or program in various fields.

Types of flowchart
Sterneckert (2003) suggested that flowcharts can be modeled from the perspective of
different user groups (such as managers, system analysts and clerks) and that there are four
general types:
a) Document flowcharts, showing controls over a document-flow through a system
b) Data flowcharts, showing controls over a data-flow in a system
c) System flowcharts, showing controls at a physical or resource level
d) Program flowchart, showing the controls in a program within a system

CHP 1 (INTRODUCTION) Page 4


B.Sc I Year / II Semester
UNIT – I   ‘C’ Fundamentals, Tokens, Control and Decision Making Statements
Standard Flowchart Symbols
Flowcharts use special shapes to represent different types of actions or steps in a process. Lines
and arrows show the sequence of these steps, and the relationships between them.

See how to use these smart symbols to construct flowcharts instantly.


Start and end symbols, represented by lozenges, ovals or rounded rectangles, usually contain the
word "Start" or "End", or another phrase signaling the start or end of a process, such as "submit
enquiry" or "receive product".

Arrows show what's called "flow of control" in computer science. An arrow coming from one
symbol and ending at another symbol signifies flow passes to the symbol the arrow points to.

Processing steps are represented by rectangles. Examples: "Add 1 to X"; "replace identified
part"; "save changes" or similar.

Input/Output are represented by a parallelogram. Examples: Get X from the user; display X.

Conditional (or decision) is represented by a diamond (rhombus). These typically contain a


Yes/No question or True/False test. This symbol is unique in that it has two arrows coming out
of it, usually from the bottom point and right point, with one corresponding to Yes or True, and
the other one corresponding to No or False. The arrows should always be labeled. More than two
arrows can be used, but this is normally a clear indicator that a complex decision is being taken,

CHP 1 (INTRODUCTION) Page 5


B.Sc I Year / II Semester
UNIT – I   ‘C’ Fundamentals, Tokens, Control and Decision Making Statements
in which case, it may need to be broken-down further, or replaced with the "pre-defined process"
symbol.
A number of other symbols that have less universal currency, such as:

Document represented by a rectangle with a wavy base;

Manual input represented by a rectangle, with the top irregularly sloping up from left to right.
An example would signify data-entry from a form;

Manual operation represented by a trapezoid with the longest parallel side upmost, to represent
an operation or adjustment to process that can only be made manually.

Data File represented by a cylinder

Flowchart for adding of 2 numbers:

Flowchart for adding of N naturals numbers:

CHP 1 (INTRODUCTION) Page 6


B.Sc I Year / II Semester
UNIT – I   ‘C’ Fundamentals, Tokens, Control and Decision Making Statements

Flowchart for Factorial of a given number

CHP 1 (INTRODUCTION) Page 7

You might also like