UNIT 1 CS m3
UNIT 1 CS m3
COMPUTER SCIENCE
UNIT 1- WHAT IS COMPUTER
NOTE - TAP ON ABOVE IMAGES COPY GROUP LINK & JOIN TELEGRAM GROUPS FOR ENGINEERING (BEE)
GUYS THIS IS OUR FIRST SERIES OF PROVIDING YOU NOTES FOR YOUR UNIVERSITY EXAMINATION
POINT OF VIEW.
A computer is an electronic device that accepts data from the user, processes
it, produces results, displays them to the users, and stores the results for future
usage.
Data is a collection of unorganized facts & figures and does not provide any
further information regarding patterns, context, etc. Hence data means
"unstructured facts and figures".
Information is a structured data i.e. organized meaningful and processed data.
To process the data and convert into information, a computer is used.
Functions of Computers:
1 RECEIVING INPUT
Data is fed into computer through various input devices like keyboard, mouse, digital
pens, etc. Input can also be fed through devices like CD- ROM, pen drive, scanner, etc.
Data entered into computer is sent to RAM, from where it is then sent to ALU,
where rest of data processing takes place. All types of processing, such as
6 CONTROL UNIT
8 MEMORY UNIT
This is unit in which data and instructions given to computer as well as results
given by computer are stored. Unit of memory is "Byte".
1 Byte = 8 Bits
9 PRODUCING OUTPUT
The processed information and other details are communicated to the outside
world through output devices like monitor, printer, etc.
1
Types of Operating System
There are four types of operating systems.
2
Basics of Popular Operating Systems
Windows Operating System is developed by Microsoft
Corporation, Linux is a multitasking operating system that
supports various users and numerous tasks. It is open source,
i.e., code for Linux is available for free of cost
4 Running an Application
The operating system offers an interface between
5
Operating System Simple Setting
We will learn different settings in Operating System such as
changing system date and time, changing display properties,
etc.
6
File and Directory Management
File is nothing but a collection of information. The information
can be of numbers, characters, graphs, images, etc. Directory is
a place/area/location where a set of file(s) will be stored.
7
File Management System
The file management system is a software which is used to
create, delete, modify and control access and save files.
8
Types of Files
There are five types of files such as Ordinary files,
Directory files, Device files, FIFO files
What is Compiler?
The compiler is software that converts a program written in a high- level
language (Source Language) to low-level language
Introduction to Algorithms:
Disadvantages of Algorithms:
Step 1: Start
Step 2: Declare variables num1, num2 and sum.
Step 3: Read values num1 and num2.
Step 4: Add num1 and num2 and assign the result to sum.
sum←num1+num2
Step 5: Display sum
Step 6: Stop
Terminal start/stop/begin/en
d
Oval
Parallelogram
Rectangle
Diamon
Circle
Flow Join 2 symbols and
also represents
flow of execution
Arrows
Pentagon
Hexagon
Printout
13 EXAMPLE
Given below is the flowchart for finding an average of three numbers −
The memory size of the basic data types may change according to 32 or 64bit
operating system.
float 4 byte
double 8 byte
1. int main()
2. {
3. int a=10;
4. int A=20;
5. printf("Value of a is : %d",a);
6. printf("\nValue of A is :%d",A);
7. return0;
8. }
Output
Value of a is : 10
Value of A is :20
16 COMMENTS IN C
1. #include<stdio.h>
2. int main(){
3. //printing information
4. printf("Hello C");
5. return
0; 6. }
1. /*
2. code
3. to be commented
4. */
5.
6. #include<stdio.h>
7. int main(){
8. /*printing information
9. Multi-Line Comment*/
10. printf("Hello C");
11. return 0;
12. }
Errors are the problems or the faults that occur in the program, which makes
the behavior of the program abnormal, and experienced developers can also
make these faults. Programming errors are also known as the bugs or faults,
and the process of removing these bugs is known as debugging.
o Syntax error o
Run-time error o
Linker error o
Logical error o
Semantic error
Syntax error:
Syntax errors are also known as the compilation errors as they occurred at the
compilation time, or we can say that the syntax errors are thrown by the
compilers. These errors are mainly occurred due to the mistakes while typing
or do not follow the syntax of the specified programming language. These
mistakes are generally made by beginners only because they are new to the
language. These errors can be easily debugged or corrected.
For example:
1. #include <stdio.h>
2. int main() 3. {
4. a = 10;
5. printf("The value of a is : %d", a);
6. return
Computational Skills Page 18
0; 7. }
Logical error:
The logical error is an error that leads to an undesired output. These errors
produce the incorrect output, but they are error-free, known as logical errors.
These types of mistakes are mainly done by beginners. The occurrence of these
errors mainly depends upon the logical thinking of the developer. If the
programmers sound logically good, then there will be fewer chances of these
errors.
Example 1: A student has written a program to find the average of their test
results.
#include<stdio.h>
void main()
{
int test1,test2,test3; int average;
average = test1 + test 2 + test3 / 3
printf(“average=%d”, average);
getch();
}
When the student runs the program, they get results that are obviously incorrect.
It is not a syntax error as the code can be compiled and run. What is the logic
error?
The program is dividing test3 by 3 and then adding it to test1 and test2.
Example 2: The student is also having problems with the following code.
int first_number; int
second_number; int
result;
result = first_number * second_number
The student should have declared them as variables able to hold decimal
numbers e.g. as float or double.
NOTE :-
➢ AS I AM PROVIDING YOU THIS NOTES BY AIMED YOU JUST HAVE TO BE PREPARED FOR YOUR
UNIVERSITY EXAMINATION
➢ IF YOU NEED ANY EXTRA MATERIAL FOR STUDY ND EXAM REFERANCE THEN ALSO YOU CAN MSG
MI PERSONALLY HERE :- FYNOTESPROVIDER
➢ WE’VE ALSO CREATED A GROUP IN THAT YOU CAN DISCUSS YOUR DOUBTS WITH YOUR FRIENDS
FROM DIFFERENT COLLEGES STUDENTS OF SAME UNIVERSITY :- rtmnuFYfriendcircle
➢ THE LAST REQUEST FROM MY SIDE IS THAT GUYS YOU JUST HAVE TO SHARE THIS NOTES WITH
YOUR COLLEGE FRIENDS ND DO CONTINUOUSLY SUPPORT TO THIS PLATFORM.