computer basics
online shopping

programming language

environment setup
data type
condition & iteration
date & time


Advanced Topics
file formats
db connections
-other db
exception handling


computer basics

Computer is an electronic data processing device, which accepts and stores data, processes the data and generates the output in a required format.

Advantages of Computers
High Speed- It can perform millions of calculations in few seconds.
Storage Capability
Diligence- Unlike human beings, a computer is free from monotony, tiredness, and lack of concentration and can work continuously without any error and boredom.
Versatility- can be used to solve the problems related to various fields.
Reduction in Paper Work and Cost




Payroll calculations
Sales analysis
Financial forecasting
Managing employee database
Maintenance of stocks, etc.

Online accounting facility, which includes checking current balance, making deposits and overdrafts, checking interest charges, shares, and trustee records.
ATM machines.

Procedure to continue with policies
Starting date of the policies
Next due installment of a policy
Maturity date
Interests due
Survival benefits


Advertising − With computers, advertising professionals create art and graphics, write and revise copy, and print and disseminate ads with the goal of selling more products.
Home Shopping − Home shopping has been made possible through the use of computerized catalogues that provide access to product information and permit direct entry of orders to be filled by the customers.

Diagnostic System − Computers are used to collect data and identify the cause of illness.
Lab-diagnostic System − All tests can be done and the reports are prepared by computer.
Patient Monitoring System − These are used to check the patient's signs for abnormality such as in Cardiac Arrest, ECG, etc.
Pharma Information System − Computer is used to check drug labels, expiry dates, harmful side effects, etc.
Surgery − Nowadays, computers are also used in performing surgery.

Engineering Design
Structural Engineering − Requires stress and strain analysis for design of ships, buildings, budgets, airplanes, etc.
Industrial Engineering − Computers deal with design, implementation, and improvement of integrated systems of people, materials, and equipment.
Architectural Engineering − Computers help in planning towns, designing buildings, determining a range of buildings on a site using both 2D and 3D drawings.

Missile Control
Military Communication
Military Operation and Planning
Smart Weapons


Sales tax department
Income tax department
Computation of male/female ratio
Computerization of voters lists
Computerization of PAN card
Weather forecasting




First Generation
The period of first generation: 1946-1959. Vacuum tube based.

Second Generation
The period of second generation: 1959-1965. Transistor based.

Third Generation
The period of third generation: 1965-1971. Integrated Circuit based.

Fourth Generation
The period of fourth generation: 1971-1980. VLSI microprocessor based.

Fifth Generation
The period of fifth generation: 1980-onwards. ULSI microprocessor based.




PC (Personal Computer)
It is a single user computer system having moderately powerful microprocessor

It is also a single user computer system, similar to personal computer however has a more powerful microprocessor.

Mini Computer
It is a multi-user computer system, capable of supporting hundreds of users simultaneously.

Main Frame
Mainframe is very large in size and is an expensive computer capable of supporting hundreds or even thousands of users simultaneously. Mainframe executes many programs concurrently and supports many simultaneous execution of programs.

Supercomputers are one of the fastest computers currently available. Supercomputers are very expensive and are employed for specialized applications that require immense amount of mathematical calculations (number crunching). For example, weather forecasting, scientific simulations, (animated) graphics, fluid dynamic calculations, nuclear energy research, electronic design, and analysis of geological data (e.g. in petrochemical prospecting).




Input Unit
This unit contains devices with the help of which we enter data into the computer. The input devices translate the information into a form understandable by the computer.

CPU (Central Processing Unit)
CPU is considered as the brain of the computer. CPU performs all types of data processing operations. It stores data, intermediate results, and instructions (program). It controls the operation of all parts of the computer.
CPU itself has the following three components −
ALU (Arithmetic Logic Unit)
Memory Unit
Control Unit

Output Unit
The output unit consists of devices with the help of which we get the information from the computer. This unit is a link between the computer and the users. Output devices translate the computer's output into a form understandable by the users.


CPU(Central Processing Unit)
CPU itself has following three components.
Memory or Storage Unit
Control Unit
ALU(Arithmetic Logic Unit)

Memory or Storage Unit
It stores all the data and the instructions required for processing.
It stores intermediate results of processing.
It stores the final results of processing before these results are released to an output device.
All inputs and outputs are transmitted through the main memory.

Control Unit
It is responsible for controlling the transfer of data and instructions among other units of a computer.
It manages and coordinates all the units of the computer.
It obtains the instructions from the memory, interprets them, and directs the operation of the computer.
It communicates with Input/Output devices for transfer of data or results from storage.
It does not process or store data.

ALU (Arithmetic Logic Unit)
This unit consists of two subsections namely,
-Arithmetic Section
-Logic Section

Arithmetic Section
Function of arithmetic section is to perform arithmetic operations like addition, subtraction, multiplication, and division. All complex operations are done by making repetitive use of the above operations.

Logic Section
Function of logic section is to perform logic operations such as comparing, selecting, matching, and merging of data.


Input Devices
Joy Stick
Light pen
Track Ball
Graphic Tablet
Magnetic Ink Card Reader(MICR)
Optical Character Reader(OCR)
Bar Code Reader
Optical Mark Reader(OMR)


Output Devices
Graphic Plotter

Dot Matrix Printer
Daisy Wheel
Drum Printer
Chain Printer
Laser Printers
Inkjet Printers




A memory is just like a human brain. It is used to store data and instructions.
Memory is primarily of three types −
Cache Memory
Primary Memory/Main Memory
Secondary Memory


Cache Memory
Cache memory is a very high speed semiconductor memory which can speed up the CPU. It acts as a buffer between the CPU and the main memory. It is used to hold those parts of data and program which are most frequently used by the CPU. The parts of data and programs are transferred from the disk to cache memory by the operating system, from where the CPU can access them.


Primary Memory (Main Memory)
Primary memory holds only those data and instructions on which the computer is currently working. It has a limited capacity and data is lost when power is switched off. These memories are not as fast as registers. The data and instruction required to be processed resides in the main memory. It is divided into two subcategories RAM and ROM.


Secondary Memory
This type of memory is also known as external memory or non-volatile. It is slower than the main memory. These are used for storing data/information permanently. CPU directly does not access these memories, instead they are accessed via input-output routines. The contents of secondary memories are first transferred to the main memory, and then the CPU can access it. For example, disk, CD-ROM, DVD, etc.



Random Access Memory
RAM (Random Access Memory) is the internal memory of the CPU for storing data, program, and program result. It is a read/write memory which stores data until the machine is working. As soon as the machine is switched off, data is erased.
RAM is of two types −
Static RAM (SRAM)
Dynamic RAM (DRAM)

Static RAM (SRAM)
The word static indicates that the memory retains its contents as long as power is being supplied. However, data is lost when the power gets down due to volatile nature. SRAM chips use a matrix of 6-transistors and no capacitors. Transistors do not require power to prevent leakage, so SRAM need not be refreshed on a regular basis.

Dynamic RAM (DRAM)
DRAM, unlike SRAM, must be continually refreshed in order to maintain the data. This is done by placing the memory on a refresh circuit that rewrites the data several hundred times per second. DRAM is used for most system memory as it is cheap and small. All DRAMs are made up of memory cells, which are composed of one capacitor and one transistor.


Read Only Memory
we can only read but cannot write on it. This type of memory is non-volatile. The information is stored permanently in such memories during manufacture. A ROM stores such instructions that are required to start a computer. This operation is referred to as bootstrap. ROM chips are not only used in the computer but also in other electronic items like washing machine and microwave oven.

Let us now discuss the various types of ROMs and their characteristics.

MROM (Masked ROM)
The very first ROMs were hard-wired devices that contained a pre-programmed set of data or instructions. These kind of ROMs are known as masked ROMs, which are inexpensive.

PROM (Programmable Read Only Memory)
PROM is read-only memory that can be modified only once by a user. The user buys a blank PROM and enters the desired contents using a PROM program. Inside the PROM chip, there are small fuses which are burnt open during programming. It can be programmed only once and is not erasable.

EPROM (Erasable and Programmable Read Only Memory)
EPROM can be erased by exposing it to ultra-violet light for a duration of up to 40 minutes. Usually, an EPROM eraser achieves this function. During programming, an electrical charge is trapped in an insulated gate region. The charge is retained for more than 10 years because the charge has no leakage path. For erasing this charge, ultra-violet light is passed through a quartz crystal window (lid). This exposure to ultra-violet light dissipates the charge. During normal use, the quartz lid is sealed with a sticker.

EEPROM (Electrically Erasable and Programmable Read Only Memory)
EEPROM is programmed and erased electrically. It can be erased and reprogrammed about ten thousand times. Both erasing and programming take about 4 to 10 ms (millisecond). In EEPROM, any location can be selectively erased and programmed. EEPROMs can be erased one byte at a time, rather than erasing the entire chip. Hence, the process of reprogramming is flexible but slow.




The motherboard serves as a single platform to connect all of the parts of a computer together. It connects the CPU, memory, hard drives, optical drives, video card, sound card, and other ports and expansion cards directly or via cables. It can be considered as the backbone of a computer.



Memory Units

Memory unit is the amount of data that can be stored in the storage unit. This storage capacity is expressed in terms of Bytes.

Bit (Binary Digit)
A binary digit is logical 0 and 1 representing a passive or an active state of a component in an electric circuit.

A group of 4 bits is called nibble.

A group of 8 bits is called byte. A byte is the smallest unit, which can represent a data item or a character.

Kilobyte (KB)
1 KB = 1024 Bytes

Megabyte (MB)
1 MB = 1024 KB

GigaByte (GB)
1 GB = 1024 MB

TeraByte (TB)
1 TB = 1024 GB

PetaByte (PB)
1 PB = 1024 TB




A port is a physical docking point using which an external device can be connected to the computer. It can also be programmatic docking point through which information flows from a program to the computer or over the Internet. Examples of external devices attached via ports are the mouse, keyboard, monitor, microphone, speakers, etc.

Serial Port
Parallel Port
PS/2 Port
Universal Serial Bus (or USB) Port
VGA Port
Power Connector
Firewire Port
Modem Port
Ethernet Port
Game Port
Digital Video Interface, DVI port
Sockets- Sockets connect the microphone and speakers to the sound card of the computer.




Software is a set of programs, which is designed to perform a well-defined function. A program is a sequence of instructions written to solve a particular problem.
There are two types of software −
System Software
Application Software

System Software
The system software is a collection of programs designed to operate, control, and extend the processing capabilities of the computer itself. System software is generally prepared by the computer manufacturers. These software products comprise of programs written in low-level languages, which interact with the hardware at a very basic level. System software serves as the interface between the hardware and the end users.
Some examples of system software are Operating System, Compilers, Interpreter, Assemblers, etc.

Application Software
Application software products are designed to satisfy a particular need of a particular environment. All software applications prepared in the computer lab can come under the category of Application software.
Application software may consist of a single program, such as Microsoft's notepad for writing and editing a simple text. It may also consist of a collection of programs, often called a software package, which work together to accomplish a task, such as a spreadsheet package.



Number System

When we type some letters or words, the computer translates them in numbers as computers can understand only numbers. A computer can understand the positional number system where there are only a few symbols called digits and these symbols represent different values depending on the position they occupy in the number.

Decimal Number System
The number system that we use in our day-to-day life is the decimal number system. Decimal number system has base 10 as it uses 10 digits from 0 to 9. In decimal number system, the successive positions to the left of the decimal point represent units, tens, hundreds, thousands, and so on.
Each position represents a specific power of the base (10). For example, the decimal number 1234 consists of the digit 4 in the units position, 3 in the tens position, 2 in the hundreds position, and 1 in the thousands position.

As a computer programmer or an IT professional, you should understand the following number systems which are frequently used in computers.
Binary Number System
Base 2. Digits used : 0, 1. Eg. 10101

Octal Number System
Base 8. Digits used : 0 to 7

Hexa Decimal Number System
Base 16. Digits used: 0 to 9, Letters used : A- F. eg. 19FDE




A computer network is a system in which multiple computers are connected to each other to share information and resources.

Characteristics of a Computer Network:-
Share resources from one computer to another.
Create files and store them in one computer, access those files from the other computer(s) connected over the network.
Connect a printer, scanner, or a fax machine to one computer within the network and let other computers of the network use the machines available over the network.

Following is the list of hardware's required to set up a computer network:-
Network Cables
Internal Network Cards
External Network Cards



Operating System

An operating system is a program that acts as an interface between the software and the computer hardware.
It is an integrated set of specialized programs used to manage overall resources and operations of the computer.
It is a specialized software that controls and monitors the execution of all other programs that reside in the computer, including application programs and other system software.

Characteristics of Operating System:-
Memory Management − Keeps track of the primary memory, i.e. what part of it is in use by whom, what part is not in use, etc. and allocates the memory when a process or program requests it.
Processor Management − Allocates the processor (CPU) to a process and deallocates the processor when it is no longer required.
Device Management − Keeps track of all the devices. This is also called I/O controller that decides which process gets the device, when, and for how much time.
File Management − Allocates and de-allocates the resources and decides who gets the resources.
Security − Prevents unauthorized access to programs and data by means of passwords and other similar techniques.
Job Accounting − Keeps track of time and resources used by various jobs and/or users.
Control Over System Performance − Records delays between the request for a service and from the system.
Interaction with the Operators − Interaction may take place via the console of the computer in the form of instructions. The Operating System acknowledges the same, does the corresponding action, and informs the operation by a display screen.
Error-detecting Aids − Production of dumps, traces, error messages, and other debugging and error-detecting methods.
Coordination Between Other Software and Users − Coordination and assignment of compilers, interpreters, assemblers, and other software to the various users of the computer systems.



Internet and Intranet

Internet is a worldwide/global system of interconnected computer networks. It uses the standard Internet Protocol (TCP/IP). Every computer in Internet is identified by a unique IP address. IP Address is a unique set of numbers (such as which identifies a computer’s location.

A special computer DNS (Domain Name Server) is used to provide a name to the IP Address so that the user can locate a computer by a name. For example, a DNS server will resolve a name https://www.tutorialspoint.comto a particular IP address to uniquely identify the computer on which this website is hosted.

Intranet is the system in which multiple PCs are connected to each other. PCs in intranet are not available to the world outside the intranet. Usually each organization has its own Intranet network and members/employees of that organization can access the computers in their intranet.



How to Buy a Computer?

Popular desktop brands are Dell, Lenovo, HP and Apple. Always compare the desktops based on their specifications and base price.

Size − It is the diagonal size of the LCD screen. Larger the area, bigger the picture screen. A bigger picture is preferable for movie watching and gaming. It will increase the productivity as well.
Resolution − This is the number of pixels on the screen. For example, 24inch display is 1920x1200 (width by length) and 22-inch display is 1680x1050. High resolution provides better picture quality and a nice gaming experience.
Inputs − Now-a-days monitors can accept inputs from cable as well apart from the computer. They can also have USB ports.
Stand − Some monitors come with adjustable stands while some may not.
Recommended − 24 Inch LCD.

Operating System
Operating System is the main software of the computer as everything will run on it in one form or other.
There are primarily three choices: Windows, Linux, Apple OS X.
Linux is free, however people generally do not use it for home purpose.
Apple OS X works only on Apple desktops.
Windows 7 is very popular among desktop users.
Most of the computers come pre-equipped with Windows 7 Starter edition.
Windows 8 is recently introduced and is available in the market.
Windows 7 and Windows 8 come in multiple versions from starter, home basic, home premium, professional, ultimate, and enterprise editions.
As the edition version increases, their features list and price increases.
Recommended − Windows 7 Home Premium.

Optical Drive
Optical drive is the drive on a computer, which is responsible for using CD, DVD, and Blu-ray discs.
Now-a-days, DVD burners are industry standards.
DVD Burner can burn CD, DVD and play them.
DVD Burner is cheaper than Blu-ray drives.
Blu-ray drives can play HD movies but are costlier component.
Recommended − DVD Burner.

RAM is considered as Computer Memory as the performance of a computer is directly proportional to its memory and processor.
Today's software and operating system require high memory.
Today commonly used RAM is DDR3, which operates at 1066Mhz.
As per Windows 7, 1 GB is the minimum RAM required to function properly.
Recommended − 4 GB.
Hard Drive
Hard disk is used for storage purpose. Higher the capacity, more data you can save in it.
Now-a-days computers are equipped with 500GB hard drive, which can be extended to 2TB.
Most hard drives in desktop operate at the standard performance speed of 7200RPM.
Recommended − 500GB.

Frequency (GHz) − This determines the speed of the processor. More the speed, better the CPU.
Cores − Now-a-days CPUs come with more than one core, which is like having more than one CPU in the computer. Programs which can take advantage of multi-core environment will run faster on such machines.
Brand − Intel or AMD. Both are equivalent. Intel is in lead.
Cache − Higher the L1, L2 cache, better the CPU performance.
Recommended − Intel Core i3-3225 3.30 GHz Processor.