Professional Documents
Culture Documents
Basic Computer Components LAN - A LAN (Local Area Network) is a system whereby individual
Computer - An electronic device that stores, retrieves, and processes PCs are connected together within a company or organization
data, and can be programmed with instructions. A computer is WAN - A WAN (Wide Area Network) as the name implies allows
composed of hardware and software, and can exist in a variety of you to connect to other computers over a wider area (i.e., the whole
sizes and configurations. world).
Hardware - refers to the physical components of your computer such Uses of Network - If ten people are working together within an office
as the system unit, mouse, keyboard, monitor etc. it makes sense for them all to be connected.
Software - the instructions that makes the computer work. Modem - Short for “MODulate/DEModulate”. The modem sends
information from your computer across the telephone system.
Types of computers
• Mini and Mainframe Computers -Very powerful, used by Uses of Computer
large organizations such a bank to control the entire Computer Based Training (CBT) offers a low-cost solution to
business operation. training needs where you need to train a large amount of people on
• Personal Computers - Cheap and easy to use. Often used a single subject.
as stand-alone computers or in a network. May be Office applications - Stock control, Accounts/Payroll, Automated
connected to large mainframe computers within big production systems, Design systems.
companies.
What are computer viruses? Viruses- are small programs that hide
Hardware Components themselves on your disks (both diskettes and your hard disk).
Input devices - A keyboard and mouse are the standard way to How do viruses infect PCs? - Viruses hide on a disk and when you
interact with the computer. Other devices include joysticks and game access the disk (either a diskette or another hard disk over a network)
pads used primarily for games. the virus program will start and infect your computer.
Output devices - The monitor (the screen) is how the computer sends ___________________________________________________
information back to you. What is a computer
Storage Devices - saves data and programs. Computer is an electronic device that accepts data from the user,
• Hard disk drives are an internal, higher capacity drive processes it, produces results, displays them to the users, and stores
which also stores the operating system which runs when the results for future usage
you power on the computer. Data is a collection of unorganized facts & figures and does not
• "Floppy" disk drives allow you to save work on small provide any further information regarding patterns, context, etc.
disks and take the data with you. Hence data means "unstructured facts and figures".
Memory Information is a structured data i.e., organized meaningful and
• RAM - Random Access Memory, the main 'working' processed data. To process the data and convert into information, a
memory used by the computer. computer is used.
• ROM – Read Only Memory, as the name suggests is a Functions of Computers – Input -> Process -> Store -> Output
special type of memory chip that holds software that can Characteristics of a computer system
be read but not written to. Memory Speed
Automation Accuracy
How Computer Memory Is Measured Reliability Diligence
Versatility
• Bit- All computers work on a binary numbering system,
i.e., they process data in one's or zero's These 1 or 0 levels
Basic Computer System
of storage is called a bit.
Components of a computer System
• Byte- A byte consists of eight bits.
• Kilobyte- A kilobyte (KB) consists of 1024 bytes. Central Processing Unit
• Megabyte-A megabyte (MB) consists of 1024 kilobytes. Control Unit
• Gigabyte- A gigabyte (GB) consists of 1024 megabytes.
Input device Arithmetic/Logic Unit
Microprocessors- "The brain of the computer “. PCs primarily use Output device
OPERATORS
WHY NOT C?
Operation Operator Example 1. Keywords - the collection of pre-defined or reserved words. Ex:
Addition + c=a+b; int, char and auto keywords
Subtraction - c=a-b; 2. Identifiers - informative names that uniquely identify variables or
Multiplication * c=a*b; function names. User-defined words used for naming of functions,
Division / c=a/b; variables, structures, unions, arrays etc.
Increment ++ ++c; • Identifiers shouldn't begin with any numerical digit and
Decrement -- --c; hence, the first character must be either an underscore or
Modulus % c=a%b; an alphabet.
Increment- This adds one to the value of the variable. The increment • Identifiers are case-sensitive and hence, both lowercase
can be applied before (prefix) or after (postfix) the variable is used. and uppercase letters are distinct.
Decrement- This subtracts one from the value of the variable. The • The length of identifiers shouldn't be more than 31
decrement can be applied before (prefix) or after (postfix) the characters.
variable is used. • Commas and blank spaces are not allowed while declaring
Modulus- The modulus operator assigns the remainder left over after an identifier.
a division. Thus, in the following code fragment, the variable count • Also, the most important rule is that we can't use keywords
is assigned to the remainder of dividing 10 by 3 (which is 1). as identifiers because keywords in C language are
Relational operators – if P=5, Q=3, then… reserved words for special purposes only.
Meaning Operator Example 3. Constants - the variables whose values are fixed and cannot be
Equal to == (P==Q) is not modified during the execution of a program once they are defined.
true They are also known as literals. Ex: const
Not equal to != (P!=Q) is true 4. Special Characters - are symbols in C language that have special
Less than < (P<Q) is not true meaning and cannot be used for any other purpose.
Greater than > (P>Q) is true Types of Special Characters:
Less than or equal to <= (P<=Q) is not Square Brackets []- represent single and multi-dimensional
true subscripts and they are used as array element reference for accessing
More than or equal >= (P>=Q) is true array elements.
to Simple Brackets ()- used for function calling and function
declaration.
Conditional Operators - used to evaluate a condition that's applied Curly Braces {}- are used to mark the start and end of a block of
to one or two Boolean expressions. The result of the evaluation is code containing executable logical statements.
either true or false. Comma (,)- used to separate variables or more than one statement
• && the logical AND operator. - is used to perform logical just like separating function parameters in a function call.
conjunction of two expressions (Result: True if both the Pre-Processor / Hash (#)- a macro-processor that is automatically
expressions evaluate to true else the result remains False) used by the compiler and denotes that we are using a header file.
• || the logical OR operator - used to perform logical Asterisk (*)- used for multiplication of variables and also for
disjunction on two expressions (Result: True if either or creating pointer variables.
both the expressions evaluate to true) Colon (:)- used as a part of conditional operator (? :) in C language.
• ?: the ternary operator Semicolon (;)- known as a statement terminator and thus, each
• | not operator - used to perform logical negation on an logical statement of C language must be ended with a semi-colon.
expression Assignment Operator (=)- used to assign values to a variable and
INPUT- allows the programmer to accept input from the keyboard. is sometimes used for logical operation validation.
• takes 2 arguments in the example. The first “%d” specifies 5. Strings- represented as an array of characters having null character
what type of data is expected. The ‘d’ character indicates '\0' at the end. This null character '\0' denotes the end of the string.
that an integer is expected. The size of the string is basically the number of characters it
• The ‘&’ preceding the variable name indicates the address contains. Ex: char name [6] = “Hello”;
6. Operators- special symbols used to perform specific functions,
of the variable.
C provides no error checking of user input. The user is expected to and data items on which they are applied upon are known as
operands.
enter the correct data type.
PREPROCESSOR- is implemented as a first pass over the C
source code, running before the main compilation stage. Performs
following tasks:
• It removes all comments
• It handles the #include statements
• It handles #define commands – these are macro definitions
• #define- preprocessor command is used to make a
program more
LIBRARIES- All C compilers come with a library of useful
functions. The programmer can simply call a library function instead
of having to write the code himself.