Professional Documents
Culture Documents
Data communication: The process of transferring data or information between computers called data
communications.
Telecommunication: It refer all types of data transmission like characters, numerical, photos, audios and
videos etc using electronic or light emitting media.
Cables (Guided Media): Cables are the most common transmission media. Two or more devices are
connected directly using cables. Three types of cables are used in computer networking they are:
Twisted pair cable: Twisted copper cables are used only for lower bandwidth. It consists of two
isolated strands of copper wire twisted around each other. There are two types of twisted pair cables
they are as follows:
UTP (Unshielded Twisted Pair): UTP cables does not have metal shield expect plastic coating. It
contains number of twisted pairs of wires with a simple plastic casing. It commonly used to for LAN
and Telephony. It is cheaper and easier to work with, but do not offer high bandwidth and good
protection from interferences. It can support data transmission rates from 10 to 100 mbps.
STP (Shielded Twisted Pair): STP is similar to UTP but it is shielded with metal sheath along with
plastic coating. It offers high bandwidth and good protection from interferences. It is cheaper than
fiber optic cable. It can support data transmission rates from 10 to 500 mbps.
Co- axial cable: A co-axial carries higher bandwidth than twisted pair, it is easy to connect. It does not
bend readily. This cable consists of one or more small cables in a protective covering. It offer very high
data transfer rate and can be placed underground and laid on the floors of lakes and oceans.
Fiber Optic cable: Fiber optic cable is a thin filament of glass fiver wrapped in a protective jacket. It
consists of strands of glass like thread, each about the diameter of a human hair. It offer high-speed
data transmission rate because data travel as high-speed pulses of light.
Thick
Very low 10 Mbps 500 meters Difficult
coax
Wireless (Unguided Media): It is used to transfer data with in a large geographical areas or globally
without the use of interconnecting wires or cables. It uses other components such as radio signals,
microwaves, or infrared to connect network.
Modulation: The process of changing some characteristics (amplitude, frequency or phase) of carrier
wave in accordance with the intensity of the signal is known as modulation.
Types of modulation:
Mode of communication:
1. Simplex mode: Simplex is one-way data transmission that takes place only from sender to
receiver. An example of this would be a television that allows the signal to pass in only one direction.
Computer network connections do not use simplex.
2. Duplex mode: Duplex is two-way data transmission that takes place both directions over a
communication channel. Computer use duplex channel. For example if computer A and computer B
are connected together than both computer can share data or information. From computer A to
computer B or computer B to computer A.
Half duplex: Half duplex is two way data transmission that takes place in only one direction at a time
Full duplex: Full duplex is two-way data transmission that takes place in both directions at a time.
Computer Network: A computer network is a logical or physical interconnection between two or more
computers such that they could communicate with each other. It is used to provide users with the access
to share resources. These shared resources include data files, application software and hardware.
It is very difficult to setup and well trained technicians are required to handle and setup.
It is expensive compare to peer to peer network.
All software and operating systems are installed in server computer so that other client computer has
to depend on it.
Peer to peer: It is also called workgroups also. Because all computers in the network have equal
responsibilities. All computers in the network have access to at least on e or more computers. It mostly
used in LAN and every organizations, research centers such as banks, travel agencies, airlines
educational institutions etc.
It is easy to setup.
Users in each computer can determine the resources to be shared among other computers.
Any required software can be installed on individual computers , they dont have to depend on the
server.
It is suitable at home, office, banks and small organization.
It is cheaper compare to client server network.
Network Topology: Set of rules and regulations, which are essential for networking are called topology. It
may contain software, hardware or geographical situation of the networking. Or in another words it is the
pattern in which the computers are interconnected.
Uses terminators to dampen Computers can be easily added or Commonly uses coaxial cable, which
signal reflection at the ends removed from the network. is prone to cable breaks. This will
of the cables. disrupt network use.
Ring Topology:
Star Topology:
NOS: The operating, which can support network environment, is called Network Operating System. For
example Windows XP, 2000, server, unix, linux, Novel Netware etc.
Note: Bandwidth : The amount of data that which is sent through a data-transmitting medium, such as a
computer network, telephone line, or coaxial cable, in a given amount of time is called band width.
Note: Bits : In computer processing and storage, a bit is the smallest unit of information handled by a
computer and is represented physically by an element such as a single pulse sent through a circuit or a
small spot on a magnetic disk capable of storing either a 1 or a 0.
Chapter: Multimedia Multimedia : The technology of combining speech, hypertext, text, still graphics,
animation, moving pictures and sound using the computing power of PC is known as multimedia. For
example TV shows, because it has a feature of interactive. Multimedia Technology: Multimedia
technology is a special computerized technique, which helps the user by providing techniques to combine
texts, pictures, sound and video films including interactive facilities. It also provides facilities to the user to
create store, edit, delete and copy those data in the computer with the help of specific computer program
such as Microsoft Power point, Adobe Acrobat, Macromedia Flash etc. Multimedia Hardware: Multimedia
system requires some additional set of hardware to support such multimedia presentation are as follows.
Computer set Sound card Sound blast DVD-ROM Microphone Headset Digital camera Video adapter
etc. Multimedia Application: Multimedia is used for any computer application in which text alone does not
work. Multimedia has become a prerequisite for computer games of all kinds. Its use is growing in
computer based education (CBE) and computer based tanning (CBT). Now a days computers use is
increase day by day and almost all sector of the world is computerized and use of multimedia technology
is also increase. There any different types of computer application available in the market. The choice is
depend on the requirements and the performance of the computer itself. Some of them are categorized
as follows: Paint program format such as: Bit Mapped Graphics (BMP or Windows Bitmap. Graphics
Interchange Format (GIF). Joint Photographic Expert Group (JPEG). Protable Network Graphics (PNG).
Image Editors or Software such as: Adobe Photoshop PhotoDeluxe CorelPhotopaint Drawing programs
or software such as: Macromedia Freehand Adobe Illustrator. Core Draw Video Editors Software and
format such as: Motion Picture Experts Group (MPEG-2) Quick Time (Format) Video for windows (AVI
format) Adobe premiere software Video VisionML Software Video Vision Studio Software Avid Cinema
Software Fusion Recorder Software Maya Software Audio software and format such as: MP3 format
Sun/Next (AU) sounds. Microsoft Windows Wav sounds format. Musical instrument digital interface (MIDI)
format. Sound Forge (Sound Editor) SoundEdit (Sound Editor) Multimedia Deck (Sound Editor) Creating
multimedia: The process of multimedia work involves several steps. Some of the important steps are
listed below: Planning the work. Creating and collecting the elements to be included in the work.
Combining the elements to create the work Testing, evaluating the refining the work Writing the work to a
portable storage medium such as a CD-ROM or posting the work on the web. There are three common
ways to organize or planning the multimedia work. They are as follows: Sequential page based
multimedia: The simple pages which containing slides of text, pictures, still graphics, videos is called
sequential page based multimedia. This type of multimedia presentation is used in college and school for
lecture and advertisement in sales company and other various purposes. Hypertext based multimedia:
This type of multimedia is attached with hypertext document in the web. It provide link to the containing
folder or files or pictures and articles. Any type of multimedia can be used such as graphics, sound, video
animation. Movie based multimedia: the work can be a movie or series of movies that stop from time to
time to enable the user to follow a link. Virtual Reality: Creation of 3D animations and games to control
flying and running items is virtual reality. Some time while using such multimedia with Head-Mounted
Display (HMD), a helmet like contraption equipped with stereo LCD displays. We feel like exploring in the
room or earth in a very complex virtual environment. The most advanced immersive technology to date is
the Cave Automotive Virtual Environment (CAVE). In WWW Virtual Reality Modeling Language (VRML) is
used to create such virtual reality animation. It is mostly used in computer games to give real experience
in virtual environment. Advantages of Multimedia: It helps to create effective presentation and tutorial
material for all subjects. It is very portable so that it can be used at any time anywhere by anybody. Very
easy to use, handle, carry, copy and store. Very helpful to transfer messages and advertisements in
WWW. It provides very powerful presentation tools with colored pictures, motion pictures and other.
Disadvantages of Multimedia: Very expensive installation cost. Require a well trained manpower or
technician. Expensive hardware components. Inaccessible to poor due to high cost.
Vision: To place Nepal on Global Map of Information Technology within next five years, is the main
vision of IT policy of Nepal 2002.
1. To flow the information after the development of web site of all ministries and departments of
government.
2. To develop E-commerce
3. To develop E-education
4. To develop E-health
Carry on research, develop and expand information technology with a high priority. So as to increase
participation of the private sector in IT development.
Prepare capable manpower with the involvement of both public and private sectors for sustainable
development and expansion of information technology.
Encourage native and foreign investment for the development information technology infrastructure.
Legalize and promote e-commerce by using information technology.
Utilize information technology in the development of rural areas.
Include computer education in curriculum from the school level.
Increase export of services related to information technology.
IT policy: some of the policies to be followed for the implementation of the above mentioned strategies
are as follows:
Action Plan: These are some action plan to fulfill the objectives of IT policy.
Legal provisions: Government of Nepal will design, update and implement the cyber laws from time to
time as per national international situation. The law will be related to e-banking, digital signature, software
piracy, data protection by encryption copyright protection and privacy protection act, etc.
Modification of IT policy: Government of Nepal will supervise the running of cyber law from time to time
and rewrite them to update. In every two alternate years continuously, it will be updated.
NITCC: NITCC stands for National Information Technology Co-ordination Committee; its main purpose is
to assist the development of IT in our country. Main functions of NITCC are as follows:
NITC: NITC stands for National Information Technology centre. It is also governmental body to work for
the development of IT in our country. It is established to develop the field of information system, to re-
observe, to know yearly development and to solve the problems. It is form by twelve members including
science and technology minister as president.
NITDC: It stands for National Information Technology Development Committee. It is form by eighteen
members, where prime minister work as president and science and technology minister work as vice-
president.
1. Consumption of time of staff member in detecting intruders and managing safety methods.
2. Physical theft of computer and computer accessories which cause a huge damage of the assets.
3. Due to the attackers, the banks and financial companies get adverse publicity.
4. Vandalize the original web page with the different contents in WWW.
5. Lost of privacy due to the unauthorized access of information.
1. Protection of computer from power related problems by using power surges and power outrages.
2. Controlling and managing database and other very imp computer with authentication systems such as
numbers.
3. Using call back systems to track the phone number which is used to connect.
4. Using firewall system to protect computer from external threats.
5. Using computer to protect from viruses.
6. Making backup regularly.
1. Plagiarism: The presentation of somebodys work as if it were your own is known as plagiarism. For
example some people or students copy the material from the internet and present them as if it is their
own creation without prior permission from the authorized person to copy from the copyrighted
material.
2. Software Piracy: Copying software CD or DVD is another big problem. People copy software and
install in their computer. Some programs are freely available in the public domain under the provision
of General Public License (GPL).
Digital signature: A security mechanism used on the internet that relies on tow keys, one public and one
private, which are used to encrypt and to decrypt them on the receipt.
Public key infrastructure (PKI): PKI is a security management system including hardware, software,
people, processes and policies, dedicated to the management of Digital Certificates (keys) for the
purposes of secure exchange of electronic messages.
Private Key: One of the two keys in digital signatures public key encryption. The user keeps the private
key secret and uses it to encrypt digital signatures and to decrypt received messages.
Public key: One of the two keys in public key encryption. The user releases this key to the public, who
can use it for encrypting messages to be sent the user and for decrypting the users digital signature.
Cyber law : The law which is practiced to control The following three basic types of computer crimes
such as: theft of computer time for development of software, theft, destruction or manipulation of
programs or data and alteration of data stored in the computer file is called cyber law. Cyber law is
the legal field that maintains the order of track in the internet access and communication.
The scopes that are covered by boundary of cyber law are as follows:
1. Intellectual property:
2. Computer crime law
3. Jurisdiction law
4. Digital signatures system
5. Privacy
6. Freedom of expression.
International cyber law: Now a days several cyber laws are applied to provide all types of computer
security, software security and avoid computer crimes. Some famous and cyber laws are as follows.
1. Fair Credit Reporting Act in 1970- free access of personal credit report.
2. Freedom of Information Act in 1970- access of information posted by the government.
3. Federal Privacy Act in 1974- access right of government to see any record.
4. Video Privacy Protection Act in 1988- prohibition of personal record without judiciary order.
5. Copyright Act 1992- Unauthorized copy of software. (5 years Jail or US$ 25,000 or both)
6. Computer Matching and Privacy - right of government to keep the personal key record
Computer Ethics: Computer Ethics covers all the practical principles that deal with how the computer
experts should make decisions in regard to the social and professional behavior. The term computer
ethics first devised by Mr. Walter Maner in mid 70s. But it is practiced from the beginning of 90s. The
core issues of computer ethics incorporate:
Ten Commandments for computer ethics: The computer Ethics Institute of the Brookings Institute,
Washington D.C has developed the following ethics:
Computer Ethics for computer professionals: The codes of conduct and good practice for certified
computer professionals are the essential elements of activity. They are:
Ethical standards: A number of definitive sets of ethics have been developed to restrict the
professionals in making harsh decisions and redirect them towards the right behavioral approach. Some
of them include:
Association for Computing Machinery (ACM) codes of ethics is four point standards that govern the
ethical behavior among the computer professionals.
Uniform Computer Information Transaction Act (UCITA) defines a set of standards related to the legal
ethical behavior during the computer contract process.
Computer security:
In the 21 st century computer is most important part of our life. The computer itself is our great and very
important property which holds several important data for the future use. So like other assets security
computer security is very important.
The protection of computer system from accidental or intestinal harm, including destruction of computer
hardware and software, physical loss of data, deception of computer users and the deliberate invasion of
database by unauthorized individuals is called computer security. In short protection of computer, its
accessories, data and programs for a long lasting of computer system is known as computer
security.
Hardware security
The protection of all hardware components used in computer system is known as hardware security. For
the proper management of physical security of the computer, we have to maintain
Regular maintenance
Computers are delicate machines. They need regular maintenance, cleaning, and configuring new
hardware removal of unnecessary hardware.
Insurance
Insurance is a very good method to protect other assets. Computer insurance helps us to insure our
computer, if we lost it or parts are damaged or in case of calamities of theft loss of data.
Free of dust
Computer parts are very sensitive to dust. Dust can damage internal and external both parts of computer
so to protect from dust we must put computer in very neat and dust free room. And we should use dust
cover also to protect computer.
Computers are easily damaged by fire. Electronic circuits of computers will get damage by fire or even
smoke also. So we should not smoke near to computer and we should manage proper wiring because it
may cause firing.
As computer is very valuable device like other assets, there is equal risk of theft for computer. We must
keep it in very secure room. There must be lock in our computer and it is advised to keep grills in windows
and safety lock in rooms.
Most of the electronic device gets damage in excessive heat. So room must be cool and dust free for
computer. If there is excessive heat then computer parts may not work properly or it may stop functioning.
It is suggested to maintain temperature between 18 o to 24 o Celsius and relative humidity of 50 to 60
percent. Micro computers can work up to maximum 30 oC also. But todays new personal computers are
designed to work even between 0 oC to 40 oC.
Power supply
Power supply is another cause of damage of computers. Computer needs 220V to 240V AC constantly.
The voltage fluctuation may damage integrated circuits of computers chips because these are the most
sensitive parts of computers. To protect from voltage fluctuation we must use UPS to protect our
computers from sudden interruption of power because in such cases UPS provide power for some
minutes to hours from backup battery inside it. Volt guard and Spike guards and Stabilizers are common
device used in these days.
Furniture
Good and properly managed furniture is another factor to protect computer hardware. Tables and chair
used in computer itself and to keep different storage devices of computers like floppy, pen drive, CD and
DVD etc
Software security
The software is very important part of the computer. It includes programs and data or information store in
computer. The protection of data and programs used in computer system is known as software
security. Software security is required for the,
For protection of data and programs in our computer system, we should apply some security measures.
Some common software security measures are as follows:
Password protection
Password is a set of characters that act like a key to unlock the system and other files and programs.
Setting password in our files and user account to control the access of data and information in our
computer is very good and effective method of software security. Password must be difficult to guess so
we should not use common words as password. It is suggested to use the set of numbers, symbols and
characters to create password.
If data and information is very important. We must backup data regularly to other computer or other disk
location and folders of the same computer so that we can restore it if data is corrupted or lost.
We can prevent the access of data or information by encrypting it. Windows operating system have built
in feature to encrypt the data. If we encrypt the data computer will change the forms of this data and will
not be readable or understood to other users. And if we have to give access we can decrypt it into original
form.
Defragmentation
Defragmentation is the process of a file to contiguous sectors on a hard disk to increase the speed of
access and retrieval. Because during long time files and folders store in computer will get fragmented or
will be unmanageable in such case disk head will consume more time to read the data from the disk
means computers becomes slower. So it is necessary to defragment the disk to increase the performance
of the computer.
Firewall protection
Windows firewall is very important and useful tool to protect our computer from external and internal
threat in LAN and Internet. While downloading files and programs form internet viruses and other person
may try to access the resources of our computer. In such case windows firewall block such threats.
Scanning disk
Computer store all information in its disk surface. And hard disk is a main part where computer store all its
information. So we must scan the surface of the to increase the performance of the computer. Windows
provide some built in tools to scan the disk such as Scandisk and CHKDSK and several other utilities
software are available to scan disk.
Hard lock key is very important for software security. It is specially used to protect from software piracy. It
is a kind of checking point available within the software during its running time.
DBMS and Microsoft Access
Introduction to Database System : In our daily life we encounter with various software. There is hardly
any software that does not use database systems. The following are some of the widely used database
systems:
Banking software
Airlines systems
University systems
Telecommunication systems
Finance
Sales
Manufacturing
Human resources
Data: Plural of the Latin datum, meaning an item if information. In practice, data is often used for the
singular as well as the plural form of the noun. Data are information to the computer which are
processed to get desired result and are the piece of information.
Information: The data which gives meaning or suitably arranged for communicating interpretation, and
processed by human being by automated means such as computer is called information.
Database: A database is a collection of data that is organized so that its contents can easily be
accessed, managed and updated.
Record: A record is a information about an element such as a person, animal, students, place etc.
Filed: A filed is a piece of information about an animal, person, students, place etc. And these fields are
the titles in the table of Ms-Access.
Importance of database:
Features of DBMS:
A set of computer
A modem and regular telephone line or broadband internet connection.
An account in ISP to access the internet host.
A communication software for example: Internet Explorer, Netscape Navigator, Mozilla Firefox or
Opera etc.
WWW: WWW is a series of services that are interconnected through hypertext. It provides link in the
web documents.
Advantages of www:
A link in a web document can be used to open other documents.
Web pages can contain pictures, buttons and even links to sound files in addition to text, thus
allowing multimedia applications.
Sophisticated web document allow users to interact with applications through dialog boxes and
forms.
Web site: Website is a location of the web pages created by any organizations, universities and
government agencies to provide information regarding them
like: http://www.bbc.co.uk/nepali,http://www.nepalnews.com etc. Each website has its own address
that is also called internet address.
Web pages: Webpage is a collection of information that is stored in website. The www consists of
huge collection of documents with related website called webpage. Webpage provides vast collection
of information of related websites.
Browser: Browser is client software that allows the users to display and interact with the web page.
For example: Internet Explorer, Netscape Navigator, Mozilla Firefox or Opera etc.
Web server: web server is a site on which the web pages are kept. It is a server computer that
responds to requests from web browsers to relative resources.
Domain name: It is a name of specific internet area controlled by any organization, company or
government.
Home page: The home page is the first hypertext document regarding the web address displayed
when a user connects to any web server.
ISP( Internet Service Provider) A company that provides individuals or companies access to the
internet and the world wide web is called ISP.
Firewall: software or hardware that limits the certain kinds of access to a computer from the internal
network or external network.
E-Mail: E-mail stands for electronic mail. It is most widely used feature on the internet. Sending and
receiving messages electronically through the internet is called E-mail. We can exchange any
message with the people around the world by using e-mail. It is very easy and quick means of
communication available in the computer world. We can write an e-mail message in an mail program
like Eudora, Outlook Express, Netscape Navigator etc. and several web base program like Yahoomail,
Hotmail, Gmail and Zapakmail are also used to send and receive e-mail.
E-mail address: Each E-mail address is identified by a unique name is called E-mail address. For
example mailme@yahoo.com, ram@fewanet.com.np, etc. It has five parts they are as follows:
Ram : Users name
@ (At the rate) : A separator symbol
Yahoo, fewanet : ISP address or domain name
.com or .edu or .net : commercial or educational groups
.np : Country code
It is cheapest and fastest means of communication and as compared our conventional postal mail.
It is more reliable than postal mail.
E-mail can be accessed from any part of the world and at any time.
Information can be share globally.
We can send photos, songs, video clips and other file with e-mail attachments.
A single mail can be send to multiple people at a time.
E-fax: E-fax stands for electronic fax. It is very powerful desktop application that allows us to send and
receive faxes directly on our computer. It is very similar to e-mail. The E-fax first goes to the internet
server then the internet server sends it to its destination whereas E-mail means first goes to the local
file server.
E-mail E-fax
2. Message first goes to the local server. 2. Message first goes to the internet server and then
to its destination.
3. Message is to be stored in the hard disk of the 3. Message directly goes to print in the printer of the
destination computer (server). destination computer.
Computer language:
Programming:
The method used to develop a solution or a program is called programming. It is way of writing program
using specific computer language to perform specific task.
Computer Language : The set of codes which is used to write computer program is called computer
language . It is artificial language and can be used to define a sequence of instructions that can ultimately
be processed and executed by the computer.
Machine level language: The program written using machine code or binary numbers (0 and 1) is
called machine level language. It is computers own binary-based language, or machine language, is
difficult for human beings to use. It is machine dependent complicated and time consuming. It is also
called first generation language.
Low level language (Assembly language) : The language which permits the use of mnemonics
(which are combination of codes and English phrases) for each instruction that machine can do is
called low level language. It remains in between machine level language and high level language. It is
easier than machine level language and should be translated into machine code using assembler. It is
also called second generation language. Example pseudo programming.
High level language : The language which uses plain English words or phrases and mathematical
notation, following the correct syntax (Certain rules which are followed to write programs) is called high
level language. It should be translated into machine code using compiler or interpreter. So they are
slower. It is also called third generation language. Example: QBASIC, C, C++, LOGO, LISP, ADA,
PASCAL etc.
Language processor : The set of program codes, which are used to translate program written in high
level language or low level language into machine code, is called language processor. There are three
types of language processor.
Interpreter : The language processor which converts High level language and Low level language into
machine code is called interpreter. It translates programming codes line by line so it is slower than
compilers and assemblers.
Compiler : The language processor which translates the program written in high level language into
machine code is called compiler.
Assembler : The language processor which translates the program written in low level language into
machine code is called assembler.
Source program : The original program written in high level language is called source program. It should
be translated into machine code, so that computer understands and responses it.
Object Program : The program converted into machine code by compiler is called object program.
It is very simple because plain English words are used for programming.
There are pre-defined commands, which minimize the work of programmers.
All the commands are syntax driven, so they are very easy to learn and implement.
I) It is machine dependent.
Introductions to C
What is C?
A large and complex program can be divided into several simpler and manageable sub modules.
Support simultaneously coding of modules by multiple programmers at a time.
Modules and functions once built here can be used in other programs.
It reduced testing and debugging time.
The program can be easily modified.
Characteristics / Features of C:
Alphabets A, B, .., Y, Z
a, b, , y, z
Digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Why Use C?
In todays world of computer programming, there are many high-level languages to choose from, such as
C, Pascal, BASIC, and Java. These are all excellent languages suited for most programming tasks. Even
so, there are several reasons why many computer professionals feel that C is at the top of the list:
C is a powerful and flexible language. What you can accomplish with C is limited only by your
imagination. The language itself places no constraints on you. C is used for projects as diverse as
operating systems, word processors, graphics, spreadsheets, and even compilers for other languages.
C is a popular language preferred by professional programmers. As a result, a wide variety of C
compilers and helpful accessories are available.
C is a portable language. Portable means that a C program written for one computer system (an IBM
PC, for example) can be compiled and run on another system (a DEC VAX system, perhaps) with little
or no modification. Portability is enhanced by the ANSI standard for C, the set of rules for C compilers.
C is a language of few words, containing only a handful of terms, called keywords, which serve as the
base on which the languages functionality is built. You might think that a language with more
keywords (sometimes called reserved words) would be more powerful. This isnt true. As you program
with C, you will find that it can be programmed to do any task.
C is modular. C code can (and should) be written in routines called functions. These functions can be
reused in other applications or programs. By passing pieces of information to the functions, you can
create useful, reusable code.
ANSI, in computer science, acronym for the American National Standards Institute, an organization of
American industry and business groups dedicated to the development of trade and communication
standards; internationally, the American representative to the International Organization for
Standardization. In the microcomputer field, ANSI is commonly encountered in three areas: programming
languages, the SCSI interface, and the ANSI.SYS device driver.
Variable : A entity whose value keeps on changing during the program execution is called
variable. A variableis a name assigned to a data storage location. Program uses variables to store
various kinds of data during program execution. In C, a variable must be defined before it can be used.
1. A variable name is any combination of 1 to 31 alphabets, digits or underscores. Some compilers allow
variable names whose length could be up to 247 characters. Still, it would be safer to stick to the rule
of 31 characters. Do not create unnecessarily long variable names as it adds to your typing effort.
2. The first character in the variable name must be an alphabet or underscore.
3. No commas or blanks are allowed within a variable name.
4. No special symbol other than an underscore (as in gross_sal) can be used in a variable name.
Ex.: si_int
m_hra
pop_e_89
These rules remain same for all the types of primary and secondary variables. Naturally, the question
follows how is C able to differentiate between these variables? This is a rather simple.
Keywords: Keywords are the words whose meaning has already been explained to the C compiler (or in
a broad sense to the computer).
Constant:A constant is a fixed entity. It does not change its value during the entre execution.
Types of constant:
Integer constants
Floating point constants
Character constants
Enumeration constants
String literals.
Operator: An operator is a symbol that instructs C to perform some operation, or action, on one or more
operands. An operand is something that an operator acts on. In C, all operands are expressions. C
operators fall into several categories:
The Assignment Operator: The assignment operator is the equal sign (=). Its use in programming is
somewhat different from its use in regular math. If you write
= y;
variable = expression;
When executed, expression is evaluated, and the resulting value is assigned to variable.
Unary Mathematical Operators: The unary mathematical operators are so named because they
take a single operand where as binary takes two operands.(for example sum= 5 + 6 i.e here are
two operands such as 5 and 6). C has two unary mathematical operators, listed in Table 4.1.
The increment and decrement operators can be used only with variables, not with constants. The
operation performed is to add one to or subtract one from the operand. In other words, the statements.
This type of operator are extensively used with looping control statement such as for, while, do etc.
++x; means ++x; will increase the value of x and then processing takes place. y; means y; will
decrease the value of y and then processing takes place. x++; means x++; will processes and then
increases the value of x by 1. y; means y; will processes and then decrement will take place.
= x + 1; y = y 1;
Modulus % Gives the remainder when the first operand is divided by the x%y
second operand
The first four operators listed in Table 4.2 should be familiar to you, and you should have little trouble
using them. The fifth operator, modulus, might be new. Modulus returns the remainder when the first
operand is divided by the second operand. For example, 11 modulus 4 equals 3 (that is, 4 goes into 11
two times with 3 left over). Here are some more examples:
Relational Operators: Cs relational operators are used to compare expressions, asking questions such
as, Is x greater than 100? or Is y equal to 0? An expression containing a relational operator evaluates
to either true (1) or false (0). Cs six relational operators are listed in Table 4.4.
Table 4.5 shows some examples of how relational operators might be used. These examples use literal
constants, but the same principles hold with variables.
Cs relational operators.
Operator Symbol Question Asked Example
Greater than or equal to >= Is operand 1 greater than or equal to operand 2? x >= y
Less than or equal to <= Is operand 1 less than or equal to operand 2? x <= y
5 == 1 Is 5 equal to 1? 0 (false)
Logical Operators: Sometimes you might need to ask more than one relational question at once. For
example, If its 7:00 a.m. and a weekday and not my vacation, ring the alarm. Cs logical operators let
you combine two or more relational expressions into a single expression that evaluates to either true or
false. Table given below lists Cs three logical operators.
Cs logical operators.
Operator Symbol Example
OR || exp1 || exp2
NOT ! !exp1
The way these logical operators work is explained in the table below
(exp1 && exp2) True (1) only if both exp1 and exp2 are true; false (0) otherwise
(exp1 || exp2) True (1) if either exp1 or exp2 is true; false (0) only if both are false
For example:
1. If .. else
2. If .. else if ..else
3. Switch case
Looping: looping is a process which allows the data to be repeated unless or until some condition has
been satisfied. The various statements are:
1. For
2. While
3. Do while
Comments : Comments are the statements that are used for user aid or remarks. The statements which
are defined as comments are ignored by C compiler comments are non-executable statements.
Comments are defined as /*your words..*/
Escape sequence : The set of characters, which are not printed when used but provide various
functions. Such escapes are start with \ back slash. For example
Bell (alert) \a
Backspace \b
Horizontal tab \t
New line \n
Carriage returns \r
Quotation mark \
Backslash \\
Null
Identifiers: Identifiers are the name givne to various program elements such as variables, functions or
arrays. It may consist both letter and digit but initial character must me letter and maximum 31 characters
can be used to name the identifiers. For example: tax_rate, tax_year, year-2065 etc.
Library Functions: Various types of built functions which can be used to execute different types of task
such as mathematical calculation, graphics management, memory management, data and file handling
etc. Example: sqrt(), to lower (), to uppor () etc. #include directive: This is the most essential directive. A
directive is links to a header files, the header file makes full use of the I/O functions of the C library. For
example #include <stdio.h> Header files: The library function which is used to declare the source of file is
called header file. For example: studio.h, conio.h, process.h, math.h, ctype.h, string.h, stdlib.h etc
Example with flowchart:
#include <stdio.h>
} printf() : The printf a function used to send formatted output to the standard output device (monitor or
printer) based on a format specification. scanf() :The scanf a function used to get formatted input to the
standard input device (keyboard) based on a format specification. getch(): The getch () function holds
from screen scrolling. It is defined in stdio.h header files. void main(): The void main() is appear in every
C program. Main without void is used when there are no arguments. main() without any parameters has
an argument.
This demonstration uses a program named HELLO.C, which does nothing more than display the words
Hello, World! on-screen. This program, a traditional introduction to C programming, is a good one for you
to learn. The source code for HELLO.C is in Program01. When you type in this listing, you wont include
the line numbers or colons.
Be sure that you have installed your compiler as specified in the installation instructions provided with the
software. Whether you are working with UNIX, DOS, or any other operating system, make sure you
understand how to use the compiler and editor of your choice. Once your compiler and editor are ready,
follow these steps to enter, compile, and execute HELLO.C.
Computer Virus
Definition: A computer program that can replicate itself by making copies itself without the users
knowledge is called virus. Virus can destroys the data files, program files and system files of the
computer.
Antivirus Software:
The programs which can detect and eliminate the computer viruses are called anti-virus software. For
example Norton, Panda, F-port, Pe-cilin, AVG, Avast, Nod32, Avira, MacAfee, Smart Dog, Kaspersky,
Sophas etc.
Solution:
Open computer in safe mode.(by pressing F8 key after you press power switch of CPU box)
Login computer by administrator or other account having administrative privileges.
Install antivirus program using program CD (CDs are good to install anti-virus program than Pen
Drives because virus can transmit in pen drive before we install anti-virus and thus it can damage anti-
virus program too) and scan the computer.
If cannot be install properly then we can restore the system in previous state (if Windows XP is
installed in the computer) from System Tools option of Accessories option of Programs of Start button.
Again try from first step after you restore the system in previous state.
There are many categories of viruses, including parasitic or file viruses, bootstrap-sector, program virus or
file virus multipartite, macro, stealth virus and script viruses.
Bootstrap-sector virus:
Bootstrap-sector viruses reside on the first portion of the hard disk or floppy disk, known as the boot
sector or Master Boot Record (MBR). These viruses replace either the programs that store information
about the disks contents or the programs that start the computer. Typically, these viruses spread by
means of the physical exchange of floppy disks. These viruses are also called as start-up infector virus.
Examples of such viruses are Danish Boot, Devel 941, Disk killer etc.
Multipartite viruses:
Multipartite viruses combine the abilities of the parasitic and the bootstrap-sector viruses, and so are able
to infect either files or boot sectors. These types of viruses can spread if a computer user boots from an
infected diskette or accesses infected files. Examples of such viruses are Invader, Flip, Tequila, etc.
Parasitic or file viruses infect executable files or programs in the computer. These files are often identified
by the extension .exe , .bin, .sys, .drv etc. in the name of the computer file. File viruses leave the contents
of the host program unchanged but attach to the host in such a way that the virus code is run first. Then it
will affect execution of the program and hence the computer becomes very slow. Examples of such
viruses are Acid Rain, Alien 298, Crazy, Brontok etc.
Script viruses:
Script viruses are written in script programming languages, such as VBScript (Visual Basic Script) and
JavaScript. These script languages can be seen as a special kind of macro language and are even more
powerful because most are closely related to the operating system environment. The ILOVEYOU virus,
which appeared in 2000 and infected an estimated 1 in 5 personal computers, is a famous example of a
script virus.
Macro viruses:
Macro virus contains inside files. Macro command which is designed to infect a specific type of document
files such as Ms Word or Ms. Excel files. Examples of such viruses are DMV, Nuclear and Word Concept.
Stealth viruses:
Stealth virus is one of the most dangerous types of viruses which really give information about the
presence of it in the computer. Generally it infects the boot sector records and program files. It is difficult
to detect using anti-virus program because it can hide in memory from the operating system and antivirus
software. Some time they can hide other files. Examples of stealth virus are Frodo, Joshi, Whale, etc.