0% found this document useful (0 votes)
8 views9 pages

Jamil Pages

algorithm flowchart

Uploaded by

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

Jamil Pages

algorithm flowchart

Uploaded by

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

1.

TITLE OF THE LAB REPORT EXPERIMENT


This report describes five exercises focused on checking prime numbers, summing even numbers,
classifying triangles, generating multiplication tables, and producing Fibonacci series. The goal is to
understand these basic mathematical concepts through practical exercises.

2. OBJECTIVES
The goals of this lab report are to:

- Determine if a number is prime.

- Calculate the sum of even numbers from 1 to a specified n.

- Classify triangles as equilateral, isosceles, or scalene based on their sides.

- Create and display the multiplication table for a given number n.

- Generate the Fibonacci series for the first n terms.


3. PROCEDURE

1. Check Prime Number

2. Summation of Even Numbers


3. Triangle Classification
4. Multiplication Table
5. Fibonacci Series
4. TEST RESULT
1. Check Prime Number

- Input: 17

- Expected Output: Prime

- Actual Output: Prime

- Input: 20

- Expected Output: Not Prime

- Actual Output: Not Prime

- Conclusion: The prime number checking function correctly identifies prime and non-prime numbers.

2. Summation of Even Numbers

- Input: n = 10

- Expected Output: 30 (2 + 4 + 6 + 8 + 10)

- Actual Output: 30

- Input: n = 20

- Expected Output: 110 (2 + 4 + 6 + ... + 20)

- Actual Output: 110

- Conclusion: The summation of even numbers function performed accurately for multiple inputs.

3. Triangle Classification

- Input: Sides = (3, 3, 3)

- Expected Output: Equilateral

- Actual Output: Equilateral

- Input: Sides = (3, 4, 5)

- Expected Output: Scalene

- Actual Output: Scalene

- Input: Sides = (3, 3, 4)

- Expected Output: Isosceles


- Actual Output: Isosceles

- Conclusion: The triangle classification function successfully identified the type of triangles based on
the side lengths.

4. Multiplication Table

- Input: n = 5

- Expected Output: 5, 10, 15, 20, 25, 30

- Actual Output: 5, 10, 15, 20, 25, 30

- Input: n = 7

- Expected Output: 7, 14, 21, 28, 35, 42

- Actual Output: 7, 14, 21, 28, 35, 42

- Conclusion: The multiplication table generation function produced accurate results for the specified
inputs.

5. Fibonacci Series

- Input: n = 6

- Expected Output: 0, 1, 1, 2, 3, 5

- Actual Output: 0, 1, 1, 2, 3, 5

- Input: n = 10

- Expected Output: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34

- Actual Output: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34

- Conclusion: The Fibonacci series function correctly generated the series for the given number of
terms.

5. ANALYSIS AND DISCUSSION


1. Analysis of Results

- The programs worked well overall, with some minor adjustments needed for special cases, especially
in the prime number check.

2. What Went Well:


- The clear structure of the exercises made it easy to implement and understand.

3. Challenges:

- The main challenges were ensuring the triangle classification and the logic for prime
numbers were correct.

4. Difficult Parts:

- Creating an efficient way to check for prime numbers was the hardest part, especially
for larger numbers.

5. What I Liked:

- I enjoyed applying theoretical concepts to practical tasks, which helped me understand


better.

6. What I Learned:

- I learned a lot about designing algorithms, debugging, and the importance of thorough
testing.

7. Mapping of Objectives:

- All goals were met successfully, showing a solid understanding of the concepts.

6. SUMMARY
This lab report explored important mathematical functions through five different exercises. The structured
approach helped deepen understanding of algorithms and highlighted the importance of accuracy in
programming.

You might also like