0% found this document useful (0 votes)
21 views6 pages

Flowcharts and Algorithms

The document provides algorithms and flowcharts for 5 problems: 1) checking if a number is even or odd, 2) checking if a number is divisible by 5, 3) checking if a user is eligible to vote, 4) calculating the area of a triangle given three sides, and 5) finding the square root of a given number.

Uploaded by

aakshayparmar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views6 pages

Flowcharts and Algorithms

The document provides algorithms and flowcharts for 5 problems: 1) checking if a number is even or odd, 2) checking if a number is divisible by 5, 3) checking if a user is eligible to vote, 4) calculating the area of a triangle given three sides, and 5) finding the square root of a given number.

Uploaded by

aakshayparmar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Algorithms

or Flowchart for the following problems:

1. input a number and check whether the entered number is even


or odd.

Answer:-

Algorithms:-

Step1: start

Step2: Read value of number from user

Step3: if (n%2 == 0), Write " even number" else Write " odd number"

Start 4 : Stop

Flowchart:-
Algorithms
or Flowchart for the following problems:

2. flowchart and algorithm to check whether a number is divisible by 5 or not.

Answer:-

Algorithms:-

Step1:start

Step2: read a value from user

Step3:if (number%5==0),write “Number is divisible by 5”,else write “Number isn’t divisible by 5”

Step4:Stop

Flowchart:-
Algorithms
or Flowchart for the following problems:
3.Flowchart and algorithm for you are eligible for vote or not.

Answer:-

Algorithm:-

Step1:start

Step2: Read an Age from the user

Step3:if (Age>=18),”write you are eligible for vote”,else write “you are not eligible for what”.

Step4:Stop

Flowchart:-
Algorithms
or Flowchart for the following problems:
4.Flowchat and Algorithms to calculate area of triangle for a,b and c three side:-

Algorithms:-

Step1:Read a

Step2:Read b

Step3:Read c

Step4:if a,b,c is>0 then; Set s=(a+b+c)/2

Step5:set area =[s(s-a)(s-b)(s-c)]^0.5

Step6:print area

Step7:Stop

Flowchart:-
Algorithms
or Flowchart for the following problems:

5.Flowchart and algorithm to find square root of given number.

Answer:-

Algorithms:-

Step1:Start

Step2:Read number from user

Step3:print number

Step4:square_root=number^0.5

Step5:print square_root

Step6:Stop

Flowchart:-
Algorithms
or Flowchart for the following problems:

You might also like