Computing Environments
Computing Environments
Personal Computing
Environment:-
• In Personal computing environment, all of the computer hardware
components are tide together. Ex: PC, laptop, mobile
Personal Computing
1 Environment
Computing Environments
Time-sharing Environment: -
• In Time-sharing environment, many users are connected to one or
more computes.
• These computers may be mini computers or central main frames.
Time-sharing
2 Environment
Computing Environments
Client/Server Environment:-
• A Client/Server Computing environment splits the computing
function between a central computer and users computers.
The Client/Server
3
Environment
Computing Environments
Distributed Computing:-
• A Distributed Computing Environment provides a seamless
integration of Computing functions between different servers and
clients.
Distributed
4
Computing
Computing Environments
Grid Computing:-
• Grid computing is a collection of computers from different locations.
• All these computers work for a common problem.
• A grid can be described as distributed collection of large number of
computers working for a single application.
5
Computing Environments
Cluster Computing:-
• Cluster computing is a collection of inter connected computers.
• These computers work together to solve a single problem.
• In , a collection of systems work together as a single system.
6
Computer Languages
• when we want to make communication between user and computer or between
two or more computers we need a language through which user can give
information to computer and vice versa. When user wants to give any instruction
to the computer the user needs a specific language and that language is known as
computer language.
• To write a program for a computer, we must use a computer language. Over the
years computer languages have evolved from machine language to natural
languages.
7
Computer Language Evolution
Computer Languages
Machine Languages: -
• In the earliest days of computer, the only programming languages available were
machine languages. Each computer has its own machine language. Which is made
of streams of 0’s and 1’s.
• Ex: 2 can be represented as 0010 and 10 can represented as 1010
• The only language understood by computer hardware is machine language
Advantages:
•A computer can easily understand the low level language.
•Low level language instructions are executed directly without any translation.
•Low level language instructions require very less time for their execution.
Disadvantages:
•Low level language instructions are very difficult to use and understand.
•Low level language instructions are machine dependent, that means a program written
for a particular machine does not executes on other machine.
•In low level language, there is more chance for errors and it is very difficult to find
Computer Languages
Symbolic Languages: -
• Symbolic language uses symbols, or mnemonics, to represent the various Machine language
instructions.
• A Special program called an assembler translates symbolic code into machine language.
• Ex: ADD for addition, SUB for subtraction , MUL for multiplication, INC for increment, DEC for
decrement, and DIV for division.
Advantages
1. Writing instructions in middle level language is easier than writing instructions in low level
language.
2. Middle level language is more readable compared to low level language.
3. Easy to understand, find errors and modify.
Disadvantages
4. Middle level language is specific to a particular machine architecture, that means it is machine
dependent.
5. Middle level language needs to be translated into low level language.
6. Middle level language executes slower compared to low level language.
9
Computer Languages
High Level languages: -
• High level languages are portable to many different computers, allowing the
Programmer to concentrate on the application problem at hand rather then intricacies of
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 the examples of high level languages.
Advantages
1. Writing instructions in high level language is more easier.
2. High level language is more readable and understandable.
3. The programs created using high level language runs on different machines with little
change or no change.
4. Easy to understand, create programs, find errors and modify.
Disadvantages
5. High level language needs to be translated to low level language.
6. High level language executes slower compared to middle and low level languages.
10
Introduction to the C Language
C is a structured programming language. It is also known as function orientated programming
language. C programming language was developed in the year of 1972 by Dennis Ritchie at Bell
Laboratories in USA (AT & T).
The following are the language before ‘c’ & various versions of ‘c’.
1. CPL (Common Programming Language by Martin Richards in 1960’s)
2. BCPL (Basic Combined Programming Language by Martin Richards in 1966 )
3. B Language (Ken Thompson and Dennis Ritchie at Bell Laboratory in 1969)
4. C Language (Dennis Ritchie at Bell Laboratory in 1972)
5. ANSI C (C89) (American National Standards Institute in 1989)
6. C90 by ISO ( International Organization for Standardization in 1990)
7. C99 by ISO (A new version of C by International Organization for Standardization in 1990)
Features of C language
1. C is a structured programming language.
2. It is a robust language with rich set of built-in functions and operators that can be used to
write any complex program.
3. The C compiler combines the capabilities of an machine language with features of a high-
level language. (it is called as middle level language)
4. Programs Written in C are efficient and fast.
5. This is due to its variety of data type and powerful operators.
6. C is highly portable this means that programs once written can be run on another
machines with little or no modification.
7. Another important feature of C program, is its ability to extend itself.
8. A C program is basically a collection of functions that are supported by C library.
9. We can also create our own function and add it to C library.
10. C language is the most widely used language in operating systems and embedded system
development today.
11. C is a Case Sensitive language.
Features of C language
Structure of C program
Structure of C program
Documentation Section (optional): The documentation section contains a set of
comments including the name of the program other necessary details. Comments are
ignored by compiler and are used to provide documentation to people who reads that
code. Comments in C programming are represented in two different ways:
1. Single Line Comment
// This is single line comment
2. Multi Line Comment
/* This is
multi line comment */
/* =================/*-------------------*/===================*/
Left on its
ignored own
Structure of C program
Link Section (Must): The link section consists of header files while contains function
prototype of Standard Library functions which can be used in program. Header file also
consists of macro declaration.
Example:
#include <stdio.h>
# is a pre processor director and
include is a preprocessor command
stdio.h is standard input/output header file
< > called angular braces.
There are two types of files to include in our program
1.Standard header files
All the standard header files must be placed in between angular braces.
Ex: #include<math.h> to use mathematical functions in our program
2. User defiles files
All the user defiled files must be placed in between double quotes.
Ex: #include”program1.c”
Structure of C program
Definition Section(Optional): The definition section defines all symbolic constants.
A symbolic constant is a constant value given to a name which can't be changed in
program.
Example:
#define PI 3.14
#define is a preprocessor command to define a constant value.
In above code, the PI is a constant whole value is 3.14.
Global Declaration Section(Optional):
In global declaration section, global variables can be declared.
These global variable can be used in both main and user defined functions.
By default all global variables are initialized to null.
Ex:
int a, b, c;
void main()
{
}
fun1()
{
}
Structure of C program
main function Section(Must): The main () function section is the most important section
of any C program. The compiler start executing C program from main() function.
The main() function is mandatory in C programming.
It has two parts:
int main()
{
...
..
...
... ..
...
}
int is the return value from main function. It returns zero to OS if program is successfully
executed.
Sub Program Section(Optional): The subprogram section contains all the user defined
functions. A complete and fully functions C program can be written without use of user-
defined function in C programming but the code maybe be redundant and inefficient if user-
defined functions are not used for complex programs.