Cit301 Summary From
Cit301 Summary From
COM
This type of language is language. The two major language closer to the
assembler.
language.
• It consumes time
• The person writing the program does not need to know anything
Independent)
machine code.
programs.
efficient.
• Machine independent
• Problem oriented
• Efficiency/cost saving- It must not cost more than its benefits and
Abstraction
This is called raising the level of abstraction. Every time you raise the level
measured in terms of bits) for less work. The language at which you
communicate with the computer can also be altered into something closer
implementation details but hide it from the outside world. The main
Modularity
Ease of Use: This approach allows simplicity, as lines of program code can
thousands and millions of lines code. This allows ease in debugging the
on a large application.
Modular Programming in C
C is called a structured programming language because to solve a large
of such functio
programs:
modify the clients using them as far as the interface does not change;
•C
•C++
•Java
•C#
•Pascal
Advantages of Structured programming
Programming paradigms
of principles.
Imperative paradigm
C, Pascal.
Functional paradigm
effects. Functions are firsts class citizens. Evaluate an expression and use
the resulting value for something. Example: Haskell, Clojure Check for
Functional paradigm
Functional paradigm
This paradigm is based on mathematics and theory of functions. The values
effects. Functions are firsts class citizens. Evaluate an expression and use
the resulting value for something. Example: Haskell, Clojure Check for
Functional paradigm
Logical paradigm
The logic paradigm fits well when applied in problem domains that deals
with the extraction of knowledge from basic facts and relations. Is based on
Answer a question via search for a solution. Examples: Prolog and List.
Brief History of C
In 1978, Dennis Ritchie and Brian Kernighan published the first edition
1988.
Many of C’s ideas & principles were derived from the earlier language B,
These programs are coded using strings of 0’s and 1’s. It doesn’t
need a translator.
Uses of C
used:
Database systems
Graphics packages
Word processors
Spreadsheets
Keywords
A data type defines a set of values and the operations that can be
Data Types
much space it occupies in storage and how the bit pattern stored is
int is used to store any integer value, float is used to store any
Constants
entity that may change. C constants can be divided into two major
categories:
•Primary Constants
•Secondary Constants
point.
integer constant.
Variables are names that are used to store values. It can take
each variable & it decides what values the variable can take.
Statements
punctuation.
Arithmetic operators
These are used to perform mathematical calculations like addition,
Jump Statements
The break statement provides an early exit from for, while, and do,
the loop.
begin. In the while and do, this means that the test part is executed
separately developed and tested. Then the linker will link all
maintain.
Function
Every C program has at least one function, which is main(), and all
Function Definition
parts
Function header
Function coding
1. Prototype or Declaration
2. Calling
3. Definition
Function Categories
follows:
String
-, *, / and $.
Structure
data types and each has a name that is used to select it from the
structure.