0% found this document useful (0 votes)
20 views24 pages

C TheorytillUNIT2smpart PDF

Software refers to a set of instructions and programs that operate computers, categorized into system software and application software. System software manages hardware resources and provides a platform for applications, while application software fulfills specific user needs. Key functions of system software include memory and file management, whereas application software focuses on tasks like document management and communication.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views24 pages

C TheorytillUNIT2smpart PDF

Software refers to a set of instructions and programs that operate computers, categorized into system software and application software. System software manages hardware resources and provides a platform for applications, while application software fulfills specific user needs. Key functions of system software include memory and file management, whereas application software focuses on tasks like document management and communication.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

What is software?

Software is a set of instructions, data or programs used to operate computers


and execute specific tasks. It is the opposite of hardware, which describes the
physical aspects of a computer. Software is a generic term used to refer to
applications, scripts and programs that run on a device

The two main categories of software are application software and system
software. An application is software that fulfills a specific need or performs
tasks. System software is designed to run a computer's hardware and
provides a platform for applications to run on top of.

System Software is the type of software that is the interface between


application software and the system. Low-level languages are used to write
the system software. System Software maintains the system resources and
gives the path for application software to run. An important thing is that
without system software, the system can not run. It is general-purpose
software.

Functions of System Software


• Memory Management
• Processor Management
• File Management
• Security
• Error-detecting Aids
• Scheduling
Features of System Software
• System software is written in a low-level language.
• The size of the system Software is smaller.
• System software is complex to understand.
• System software is present near hardware components.
Types of System Software
1. Operating System: Operating System is the main part of the Computer
System. It has the responsibility of managing all the resources such as CPU,
Printer, Hard Disk, etc. It also provides services to many other Computers
Softwares. Examples of Operating Systems are Linux, Apple, macOS,
Microsoft Windows, etc.
2. Language Processor: System Software converts Human-Readable
Language into a Machine Language and it is done by Language Processor.
It converts programs into instructions that are easily readable by Machines.
3. Device Driver: A Device Driver is a program or software that helps to
perform its functions by controlling the device. You first have to install a
driver for running the program.
Difference Between System Software and
Application Software
In the era of Digitalization and Modernization, Software is the very crucial support
that allows hardware to perform various useful tasks. There are two categories of
software; System Software and Application Software, these types perform different
work which is why it is crucial to understand the difference. \
Application software is created to help users to perform specific tasks directly and
System software acts as a mediator between hardware and user applications.
Computer Software is a sort of program that allows clients to work on different
assignments or use them to work on their System. It tells the working and
responsibilities of the System.
Basically, Software is a set of instructions or commands that tells a user how to do
and what to do. In this article, we will look into these topics in detail along with their
differences.
Types of Software
• System Software
• Application Software
What is System Software?
System Software is the type of software that is the interface between application
software and the system. Low-level languages are used to write the system software.
System Software maintains the system resources and gives the path for application
software to run. An important thing is that without system software, the system can
not run. It is general-purpose software.
Functions of System Software
• Memory Management
• Processor Management
• File Management
• Security
• Error-detecting Aids
• Scheduling
Features of System Software
• System software is written in a low-level language.
• The size of the system Software is smaller.
• System software is complex to understand.
• System software is present near hardware components.
Types of System Software
1. Operating System: Operating System is the main part of the Computer System. It
has the responsibility of managing all the resources such as CPU, Printer, Hard Disk,
etc. It also provides services to many other Computers Softwares. Examples of
Operating Systems are Linux, Apple, macOS, Microsoft Windows, etc.
2. Language Processor: System Software converts Human-Readable Language into a
Machine Language and it is done by Language Processor. It converts programs into
instructions that are easily readable by Machines.
3. Device Driver: A Device Driver is a program or software that helps to perform its
functions by controlling the device. You first have to install a driver for running the
program.
What is Application Software?
Application Software is the type of software that runs as per user request. It runs on
the platform which is provided by system software. High-level languages are used to
write the application software. It’s a specific purpose software. The main difference
between System Software and Application Software is that without system software,
the system can not run on the other hand without application software.

Functions of Application Software


• Information and data management
• Management of documents (document exchange systems)
• Development of visuals and video
• Emails, text messaging, audio, and video conferencing, and cooperation
are all options.
• Management of accounting, finance, and payroll
• Management of resources (ERP and CRM systems)
Features of Application Software
• Application software is written in a high-level language.
• Application software requires more storage space than system software.
• Only a single task is performed by each application software.
• Application Software is easy to build in comparison to system software.
Types of Application Software
1. General Purpose Software: This Application Software is used to perform
tasks that are used for a variety of tasks, just not limited to a specific task
only. For Example, MS Word, MS Excel, etc.
2. Customized Software: It is used to perform tasks that are designed for
specific organizations. For Example, Railway Reservation System, Airline
Reservation System, etc.
3. Utility Software: It is used to support the architecture of the Computer. It
is designed for optimizing and maintaining the system and also taking care of
its requirements.
Utility software helps manage and optimize a computer system to improve
efficiency, functionality, and productivity. It differs from application software,
which is designed to perform tasks for the user. Some common types of utility
software include:

• Antivirus software: Protects your system from viruses, malware, and other online
threats

• Disk cleanup tools: Removes temporary data and unnecessary files to free up disk
space

• System optimizers: Improves startup times, manages resources, and optimizes settings
to enhance system performance

System Software and Application Software

Difference Between System Software and Application Software


System Software Application Software

System Software maintains the system


Application software is built for
resources and gives the path for
specific tasks.
application software to run.

Low-level languages are used to write the While high-level languages are used
system software. to write the application software.

While it’s a specific purpose


It is general-purpose software.
software.
System Software Application Software

Without system software, the system While Without application software


stops and can’t run. system always runs.

System software runs when the system is


While application software runs as
turned on and stops when the system is
per the user’s request.
turned off.

Example: System software is an operating Example: Application software is


system, etc. Photoshop, VLC player, etc.

Application software programming is


System Software programming is more
simpler in comparison to system
complex than application software.
software.

The Software that is designed to control, A set of computer programs installed


integrate and manage the individual in the user’s system and designed to
hardware components and application perform a specific task is known as
software is known as system software. application software.

A system software operates the system in


Application software runs in the front
the background until the shutdown of the
end according to the user’s request.
computer.

The system software has no interaction Application software connects an


with users. It serves as an interface intermediary between the user and
between hardware and the end user. the computer.

System software runs independently. Application software is dependent on


system software because they need
System Software Application Software

a set platform for its functioning.

An algorithm is a set of rules or step-by-step instructions for solving a problem


or completing a task, while a flowchart is a diagram that visually represents an
algorithm:

• Algorithm
A set of rules or step-by-step instructions that define how a program is executed.

• Flowchart
A diagram that visually represents an algorithm, using boxes and arrows to show the
steps in a process.

Algorithms and flowcharts are interdependent in computer


programming. Flowcharts can help explain algorithms more easily, and vice
versa. Flowcharts are used in many fields to analyze, design, document, or
manage processes and programs.

Algorithm :

The word Algorithm means “a process or set of rules to be followed in


calculations or other problem-solving operations”. Therefore Algorithm refers
to a set of rules/instructions that step-by-step define how a work is to be
executed in order to get the expected results. Let’s take a look at an example
for a better understanding.
What is a Flowchart?
A flowchart is a graphical representation of an algorithm. Programmers often
use it as a program-planning tool to solve a problem. It makes use of
symbols that are connected among them to indicate the flow of information
and processing. The process of drawing a flowchart for an algorithm is
known as “flowcharting”. Example: Draw a flowchart to input two numbers
from the user and display the largest of two numbers.
=====================================================================================
Here are some types of computer languages:

• Machine language
Also known as binary language, machine language is made up of binary and
hexadecimal characters.

• Assembly language
A low-level language that's designed to communicate with a computer's
hardware. Assembly language is similar to machine code, but uses words instead of
numbers.

• High-level language
A programming language that's easier for humans to understand and write. High-level
languages are closer to natural language and are less dependent on the computer's
hardware.

• C++
An intermediate-level language that includes both high and low-level language
features. C++ is portable, meaning programs written in C++ can run on different
operating systems.

• Python
A high-level language that's often used for data science, artificial intelligence, and
machine learning. Python is also used for scripting and web development.

• Fortran
A high-level language that's mainly used by the scientific community. Fortran is fast
and portable, and handles arrays and parallelism well.

• Java
A high-level language that's human-readable and has a simple syntax.
MACHINE LANGUAGE ASSEMBLY LANGUAGE

It is a middle-level language, which lies between the


It is a low-level language, also known as a
high-level language and low-level language and is
first-generation language.
also known as a second-generation language.

The assembly language commands have a


Codes of machine language do not have
particular syntax like the English language. It is
syntax, it is present as 0s and 1s.
known as a mnemonic.

Machine language statements are not Assembly language statements are human-
human-readable or understandable. understandable language statements.

Since assembly language commands can be


Since these codes are in machine-
understood by humans and not machines, thus an
understandable form(binary language), thus
assembler is used to convert assembly language to
no compiler or interpreter is required.
machine language.

It is easy to memorize the instructions of assembly


It is very difficult to memorize this as they are
language since they contain alphabets and
present as only 0s and 1s.
mnemonics.

The execution of instructions of machine The execution of programs in assembly language is


language is fast since all the data is present slow because it first needs to be converted to
as 0s and 1s. machine language.

The codes of machine languages vary from


The mnemonics in the assembly language remain
application to application. It is hardware
the same irrespective of the application.
dependent.

These serve as codes for various electronic devices


These serve only as codes for machines like
like computers, microprocessors and
CDs, DVDs, and Blu-ray discs. microcontrollers, apps, and various real-time
systems.

The facility of error fixing and modifications is


Codes in assembly language allow the fixing of
not feasible in machine language since it is
errors as well as modifications according to
only present as a machine-understandable
applications.
form.

It only has 0s and 1s as well as hexadecimal


It has mnemonics such as Add, Sub, Mul, Div, etc.
and octadecimal.

1. Compiler
The language processor that reads the complete source program written in
high-level language as a whole in one go and translates it into an equivalent
program in machine language is called a Compiler. Example: C, C++, C#.
In a compiler, the source code is translated to object code successfully if it is
free of errors. The compiler specifies the errors at the end of the compilation
with line numbers when there are any errors in the source code. The errors
must be removed before the compiler can successfully recompile the source
code again the object program can be executed number of times without
translating it again.

2. Assembler
The Assembler is used to translate the program written in Assembly
language into machine code. The source program is an input of an
assembler that contains assembly language instructions. The output
generated by the assembler is the object code or machine code
understandable by the computer. Assembler is basically the 1st interface that
is able to communicate humans with the machine. We need an assembler to
fill the gap between human and machine so that they can communicate with
each other. code written in assembly language is some sort of
mnemonics(instructions) like ADD, MUL, MUX, SUB, DIV, MOV and so on.
and the assembler is basically able to convert these mnemonics in binary
code. Here, these mnemonics also depend upon the architecture of the
machine.
For example, the architecture of intel 8085 and intel 8086 are different.

3. Interpreter
The translation of a single statement of the source program into machine
code is done by a language processor and executes immediately before
moving on to the next line is called an interpreter. If there is an error in the
statement, the interpreter terminates its translating process at that statement
and displays an error message. The interpreter moves on to the next line for
execution only after the removal of the error. An Interpreter directly executes
instructions written in a programming or scripting language without
previously converting them to an object code or machine code. An interpreter
translates one line at a time and then executes it.
Example: Perl, Python and Matlab.

Loader
The loader is a specialized operating system module that comes last in the
picture. It loads the final executable code into memory.
Afterward, it creates the program and data stack. Then, it initializes
various registers and finally gives control to the CPU so that it can start
executing the code.

Unit II
tructure of C program
In this section you will learn Structure of C program. How is C program look like? There
are total 5 section of C program. You will learn basic skeleton of C program or you can
say basic things of C program.
Total 5 section are there:

1. Comment.
2. Pre-processor Directives.
3. Declaration.
4. Main Function.
5. User Define Function.

Comment in C
C program contain group of statement. All statement execute in program but some of
the statement not execute. That are called comment statement. Comment are the C
program statement which will not execute. We can also say it None-Executable
statement.

Why we make comment?


Why we make comment in program that question come in beginner programmer mind.
Basically comment are used to provide the some useful information or some small
documentation about the program. Most of the time we use comment statement in large
program.

What is the advantage of Comment?


1. Code more readable.
2. Easy to understand the logic of program.

How many types comment are there in C?


In C language we have two types comments.

1. Single Line Comment.


2. Multiline Comment.
Example of Single Line Comment:
To make the single line comment we use two backward slash " // " symbol. This is
called single line comment statement. In this program we are giving the information
about the program by comment section. Comment section never will execute.

Now see the program code. By comment we are giving the information about the
program logic. Like we are printing the value of variable " a ".

Example of comment:

void main()

int a=10;

clrscr();

//printing the value of variable a.

printf("Value of A is: %d",a);

getch();

Output:

Value of A is: 10

Example of Multiline Comment:


To make the multiline comment we use two backward slash with two asterisk symbol “ /*
*/ “. This is called multiline comment statement. In this program we are giving the
information about the program by comment section. Comment section never will
execute.

Now in this program code we are making multiline comment by giving more information.

void main()

int a=10;

clrscr();

/*printing the value of a variable by

taking single variable. this is our simple

program of C.*/

printf("Value of A is: %d",a);

getch();

Output:

Value of A is: 10

Pre-processor Directives
hash (#) symbol is called pre-processor and include called directives. Both together
called pre-processor directives.

#include
Declaration
In C we have two type's declaration. Declaring a variable or a function called
declaration.

1. Local Declaration
2. Global Declaration

Local Declaration
Declaring a variable inside the function or within the block called local declaration,
whose scope is within the function.

Example of local declaration:

fun()

int a = 10;

printf(" %d ",a);

fun1()

In above example fun1() cannot access the variable "a" because the scope of variable
is within the block or within the function.
Global Declaration
Declaring a variable outside the function called global declaration, whose scope is
outside the function and inside the function.

Example of global declaration:

int a = 10;

fun()

fun1()

In above example variable "a" declared as a global variable and both function can
access the global variable.

main function
Every program will have main function. main function is the entry point of the program
execution. When we execute the program, compiler first execute the main function.

User define function


User define function also called subroutine function.
Static memory allocation

This happens when you declare a global or static variable, which defines a fixed-size
block of memory. The memory is allocated during compile time and the size and location
of the memory cannot be changed.

• Dynamic memory allocation


This happens when you allocate memory during runtime, such as to change the size
of an array or reallocate memory. The library function malloc() is used to allocate a
block of memory on the heap. The program accesses the memory using a pointer
returned by malloc(), and the memory is deallocated when the pointer is passed to
free()

• Character set
The C programming language supports four types of characters: alphabets, digits,
special characters, and white space.

• Keywords
These are reserved words with predefined meanings that are used to write programs
in C. They cannot be used as variable names or identifiers.

• Data types
C has several built-in data types, including:

• Char: Represents the character data type and stores a variable with a single character. It
has two subtypes: signed char and unsigned char.

• Float: Stores decimal values in variables. It has a storage size of 4 bytes and can store up
to 6 digits after the decimal point.

• Union: A special data type that stores multiple types of data in the same memory location.

• Struct: A user-defined data type that stores variables of different data types.
Type of operator:
In C programming language, unary, binary &ternary operators are useful for carrying out
mathematical operations.

1. Unary operators are those that work on single operand e.g. increment operator(
++) or the decrement operator( - - ). int a =b++; or something like int C =d- -;
2. Binary operators are the one that operate on two operands e.g. ‘+’, ‘ -’, ‘ *’, ‘/’.
Syntax can be like int C=a+b;
3. Ternary operators are the one that operates on three operands. It takes three
argumets . 1st argument is checked for its validity . If it is true 2nd argument is
returned else third argument is returned. For example if we write int C= a>b ? e:f;
now if a is greater than b 'e' is returned otherwise 'f' is returned

Bitwise operators in C are used to perform bit-level operations on integer data


types. These operators work directly on the individual bits of the binary
representation of the numbers. The primary bitwise operators are AND, OR, and
XOR, each of which performs a distinct operation at the bit level of the
operands.

1. The & (bitwise AND) in C takes two numbers as operands and does AND
on every bit of two numbers. The result of AND is 1 only if both bits are
1.
2. The | (bitwise OR) in C takes two numbers as operands and does OR on
every bit of two numbers. The result of OR is 1 if any of the two bits is 1.
3. The ^ (bitwise XOR) in C takes two numbers as operands and does XOR
on every bit of two numbers. The result of XOR is 1 if the two bits are
different.
4. The << (left shift) in C takes two numbers, the left shifts the bits of the
first operand, and the second operand decides the number of places to
shift.
5. The >> (right shift) in C takes two numbers, right shifts the bits of the first
operand, and the second operand decides the number of places to shift.
6. The ~ (bitwise NOT) in C takes one number and inverts all bits of it.
Let’s look at the truth table of the bitwise operators.

X& X| X^
X Y Y Y Y

0 0 0 0 0

0 1 0 1 1

1 0 0 1 1

1 1 1 1 0
https://www.youtube.com/watch?v=cy2JF6iFv8k

Right Shift:
10>>3(no. of steps)divided by 2
https://www.youtube.com/watch?v=27p2Dcc-B5o

https://www.log2base2.com/C/bitwise/bitwise-left-shift-operator-in-c.html

You might also like