Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Programming In C languaga, Lecture notes of Computer Science

DDR4 SDRAM provides the lower operating voltage (1.2V) and higher transfer rate. The transfer rate of DDR4 is 2133~3200 MT/s. DDR4 adds four new Bank Groups technology. Each bank group has the feature of singlehanded operation

Typology: Lecture notes

2017/2018

Uploaded on 08/20/2018

shyamsandeep28
shyamsandeep28 🇮🇳

1 document

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Question : What is the Algorithm? Explain with example and Characteristics.
Algorithm: Algorithm is a method to solve a problem step by step. It is method of representing the step by
step logical procedure to solve a problem.
The Main Characteristics. Of the Algorithm are-
Finiteness: - an algorithm terminates after a finite numbers of steps.
Definiteness: - Each step in algorithm is unambiguous. This means that the action specified by the step
cannot be interpreted (explain the meaning of) in multiple ways & can be performed without any confusion.
Input:- an algorithm accepts zero or more inputs
Output:- it produces at least one output.
Effectiveness:- it consists of basic instructions that are realizable. This means that the instructions can be
performed by using the given inputs in a finite amount of time.
Example
Write a algorithm to add the two number.
Step 1: Read The Value of A and B
Step 2: Compute The Sum Of A and B [ sum =A+B]
Step 3: Print The Sum
Step 4: END
Question: What is the Flow Chart? Explain with Example And Symbol of flow chart?
Flow Chart: A flowchart is a graphic representation of algorithm . it is a graphic representation of how a
process works, showing, at a minimum, the sequence of steps. It is defend as a pictorial representation of a
process .
Flow chart use some symbol to represent data, flow , process. The basic symbol of flow chart is given blow
Here is a more comprehensive library of flowchart symbols.
Example :
Draw a flowchart to add two numbers entered by user.
Question : What is the difference between Flowchart and Algorithm.
UNIT 1 ( COMPUTER PROGRAMMING IN C)
pf3
pf4
pf5

Partial preview of the text

Download Programming In C languaga and more Lecture notes Computer Science in PDF only on Docsity!

Question : What is the Algorithm? Explain with example and Characteristics.

Algorithm: Algorithm is a method to solve a problem step by step. It is method of representing the step by step logical procedure to solve a problem.

The Main Characteristics. Of the Algorithm are-

Finiteness: - an algorithm terminates after a finite numbers of steps.

Definiteness: - Each step in algorithm is unambiguous. This means that the action specified by the step cannot be interpreted (explain the meaning of) in multiple ways & can be performed without any confusion.

Input:- an algorithm accepts zero or more inputs

Output:- it produces at least one output.

Effectiveness:- it consists of basic instructions that are realizable. This means that the instructions can be performed by using the given inputs in a finite amount of time.

Example

Write a algorithm to add the two number. Step 1: Read The Value of A and B Step 2: Compute The Sum Of A and B [ sum =A+B] Step 3: Print The Sum Step 4: END Question: What is the Flow Chart? Explain with Example And Symbol of flow chart? Flow Chart: A flowchart is a graphic representation of algorithm. it is a graphic representation of how a process works, showing, at a minimum, the sequence of steps. It is defend as a pictorial representation of a process.

Flow chart use some symbol to represent data, flow , process. The basic symbol of flow chart is given blow Here is a more comprehensive library of flowchart symbols.

Example : Draw a flowchart to add two numbers entered by user.

Question : What is the difference between Flowchart and Algorithm.

Question : What is the operating system? Explain it with function and its types in detail.

Operating System: Operating System is a software program that acts as an interface between the user and the computer. It is a set of programs and without operating system a computer cannot any task. An operating system is the software component of a computer system that is responsible for the management and coordination of activities and the sharing of the limited resources of the computer.

The main function of the operating system are

  1. File Management

HARDWARE

APPLICATIO N SOFTWARE

OPERATING SYSTEM

USER

4. Real Time Operating System:- It is an OS where there are a number of possibly unrelated external

activities needed to be controlled by a single processor system. In such systems a hierarchical interrupt system was coupled with process prioritization to ensure that key activities were given a greater share of available process time.

5. Network Operating System:- A network operating system (NOS) is software that controls a network

and its message (e.g. packet) traffic and queues, controls access by multiple users to network resources such as files, and provides for certain administrative functions, including security.

6. Distributed Operating System:- Distributed systems are very much like traditional operating

systems. First, they act as resource managers for the underlying hardware, allowing multiple users and applications to share resources such as CPUs, memories, peripheral devices, the network, and data of all kinds. Second, and perhaps more important, is that distributed systems attempt to hide the intricacies and heterogeneous nature of the underlying hardware

7. Multitasking Operating System: A multitasking operating system is any type of system that is

capable of running more than one program at a time. Most modern operating systems are configured to handle multiple programs simultaneously, with the exception of some privately developed systems that are designed for use in specific business settings.

Question : What is the Language? Explain the high level language and low level language and write down the difference between languages. A program is a set of instruction which is executed by computer. A Programming language consists of all the Symbols. Characters and usage rules that permit the people to communicate with computers. There are two major types of programming languages: (a) Low level language (b) High level language

Low Level Language : Low language is a machine code or close to it. Computer cannot understand instructions given in high level language or in English. It can understand only machine language. This is dividing in to two categories

  1. Machine Language
  2. Assembly Language

Machine Language :

It contains the strings of binary numbers (0’s and 1’s0) and is machine dependent. It means that the machine language for every processor is different. The machine language is divided into two parts :

a. Operation code (opcode)

b. Operands (binary data)

The main advantage is that the processor can execute without any transaction. The disadvantages of machine language are as follows: ( i ) Writing a program in machine to language is very difficult as for every task the machine language codes are to be searched and remembered. ( ii ) As it tis machine dependent, so the user cannot use the same code on different machine (2 nd generation language).

Assembly Languages or Symbolic Language :

Assembly language use symbol or mnemonics to represent the instruction. it is not easy to understand and the assembler is use to convert the assembly language in to machine code.

Advantages ( i ) They are time and reduce details. ( ii ) Fewer errors are made and those that are made are easier to find. ( iii ) Assembly programs are easier to modify than the machine language. ( iv ) Easier to understand and use.

Disadvantages ( i ) the coding to assembly language is time consuming. (ii) It is also machine oriented as the code for one machine is not used by the other one. These machine and assembly languages both are low level languages.

High Level Languages To overcome the difficulties to low level languages the High Level Languages were developed. High level language are easier to learn and write. High Level Language is basically symbolic language that use English words and mathematically symbol. And it is near to human language. It is provide user friendly programming environment.

Example: C, C++, Java

(i) These are easier to learn than Low Level Language. (ii) It required less time to write (iii) they provide better documentation. (iv) Easier to maintain. (v) They are not machine oriented.

Comparison of High Level Language, Assembly Language and Machine Language.

High Level Language Assembly Language Machine language 1- These are easily understandable and near to human language

2- Programs are portable.

3- Debugging is easier

4- Most suited for software development. Programs are translated using computer and interpreter to generate object code.

1- Less understandable than High level language but more than machine languages.

2-Not portable-portable to processor to same interpreter only.

3- Debugging is more complex

Than in High level language.

  1. Not suitable for software development. Use assembler to generate object

1- Programs are less understandable.

2- Not portable only processor of same architecture.

3- Not good as high level language and assembly language

4-No translation is required language.

Question: What is the compiler?

Compiler: A compiler is a program that transforms the high level language code into machine language code that is read by the computer. A compiler translates a program written in a high level programming language in to low level machine language.