UNIT-1
OVERVIEW OF C PROGRAMMING
- COMPONENTS OF COMPUTER :
In the computers input is given with help of input device like keyboards and mouse, based on a instruction cpu performance the processing and display the output on the output screen with the help of the output device.
Algorithm :
An Algorithm using finite set of unambiguous instruction which can be executed perform and task correctly.
There are three characteristics of an algorithm they are as follow :
- The number of steps required to perform task should be finite.
- Which instructions should be unambiguous nature. meaning the output should be definite and predictable.
- Finally the algorithm should solve the problem correctly.
- Start
- Input First number in A.
- Input Second number in B.
- Input Third number in C.
- Compute Sum = A+B+C
- Display Sum.
- End
Question-2 Develop an algorithm to find area of rectangle.
- Start Input
- Length in A.
- Input Breath number in B.
- Compute Area = A.B
- Display area.
- End
Question-3 Develop an algorithm to find average of three numbers
- Start
- Input First number in A.
- Input Second number in B.
- Compute Average = (A+B+C)/3
- Display Average.
- End
Question-4 Develop an algorithm to find maximum of two numbers Entered by user .
- Start
- Input First number in A.
- Input Second number in B.
- if(A>B), then
Else, max = B
5.Display max.
6.End.
Question-5 Develop an algorithm to find whether number entered by user is odd or even.
- Start
- Input First number in A.
- if a%2 == 0, then
Display A is odd
4.End
- Flowcharts
Graphical representation of flow of program is known as flowchart
The flowchart helps us graphically visualize the flow of program.
The flowchart uses some standard notations to graphically represent the logic.