Вы находитесь на странице: 1из 5

Ex No :3

PROBLEM FORMULATION, SOLVING AND FLOWCHARTS

AIM:To Draw a Flowchart for the following using MS-WORD .


a) To find the sum of digits of an integer.
b) To find the greatest of three numbers.
PROCEDURE:
Step 1: Open a new word document using Filenew option.
Step 2: To select a Flowchart symbol, Select InsertShapesFlowchart option.
Step 3: To insert a symbol into the document click anywhere in the document and
left click the mouse. Repeat step 2 and 3 for each symbols that you want to add.
Step 4: To add text into the symbol, Select the symbol then do right click the
mouse and select add text and type the text.
Step 5: To connect the different symbols, select arrows, lines from
InsertShapes.
Step 6: To Group/Ungroup the flowchart symbols and lines in the document,
select the symbols that you want to group by Home Select Objects then do right
click the mouse and select GroupingGroup/Ungroup from the menu.
Step 7: Save the documents by pressing CTRL+S or Click on Save button on
standard tool bar or select the save option from the file menu.
3.a ) ALGORITHM: To find the sum of digits of an integer
Step 1: Start

Step 2: Read the variable N


Step 3: Assign the variable sum=0, R=0
Step 4: Set a loop using the condition while(N>0), if yes.
R=N%10;
Sum=Sum+R;
N=N/10;
Step 5: Print sum.
Step 6: else, Exit.
Step 7: Stop
Explanation:
For Example:
If N=123,
N=123
Sum=0, R=0
While(123>0)
{
R=123%10=3;
Sum=0+3=3;
N=123/10=12;
}

Print sum
Exit
OUTPUT: Flowchart to find the sum of digits of an integer

start

Read N

Sum=0, R=0

WHILE
(N>0)

R=N%10

Print sum

Sum=sum + R

N=N/10

stop

3.b ) ALGORITHM : To find the greatest of three numbers


Step 1: Start
Step 2: Read three numbers A, B, C
Step 3: Check if (A>B)&&(A>C)
Step 3.1: Print A is Big
Step 4: Otherwise check if (B>C)
Step 4.1: Print B is Big.
Step 5: Else print C is Big.
Step 6: Stop

OUTPUT: Flowchart

to find the greatest of three numbers

Start

Read A, B, C

IS (A>B)

IS (A>C)

Big A

IS (B>C)

Big B

Big C

Print Big

stop

RESULT:-

Thus the flowcharts to find the sum of digits of an integer and to find
the greatest of three numbers have been created in Microsoft word successfully and
verified.

Вам также может понравиться