0% found this document useful (0 votes)
3 views3 pages

Lab 06 Functions

This document outlines a lab assignment focused on functions in Flowgorithm, detailing eight tasks. Each task includes specific instructions for creating functions that perform various operations, such as finding the maximum of two numbers, counting digits, checking for perfect squares, and more. The objective is to enhance understanding of function creation and number manipulation.
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)
3 views3 pages

Lab 06 Functions

This document outlines a lab assignment focused on functions in Flowgorithm, detailing eight tasks. Each task includes specific instructions for creating functions that perform various operations, such as finding the maximum of two numbers, counting digits, checking for perfect squares, and more. The objective is to enhance understanding of function creation and number manipulation.
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/ 3

Introduction to Computing

Lab 06

Topic Flowgorithm

Objective Functions
Lab Tasks
Task 01: Find Maximum of Two Numbers

Write a function that returns the greater of two numbers.


• Steps for Function:

1. Create a function that takes two numbers as input.


2. Return the larger number.

Task 02: Count Digits in a Number

Write a function to count the number of digits in a number.


• Steps for Function:

1. Create a function that takes one number as input.


2. Count and return the total number of digits.

Task 03: Check for Perfect Square

Write a function to check if a number is a perfect square.


• Steps for Function:

1. Create a function that takes a number as input.


2. Return True if the number is a perfect square, else return False.

Task 04: Reverse a Number

Write a function to reverse a number.


• Steps for Function:

1. Create a function that takes a number as input.


2. Return the reversed number.
Task 05: Return Absolute Value

Write a function that returns the absolute value of a number.


Helps understand negative number handling.
• Steps for Function:

1. Create a function that takes one number as input.


2. Return its absolute value (positive form).

Task 06: Find the Remainder

Write a function to return the remainder when one number is divided by another.
Useful for modulus practice.
• Steps for Function:

1. Create a function that takes two numbers.


2. Return the remainder (first number % second number).

Task 07: Count Number of Zeros in a Number

Write a function to count how many zero digits are in a number.


Good for digit-level handling and condition checking.
• Steps for Function:

1. Create a function that takes a number as input.


2. Return how many digits in the number are 0.

Task 08: Return the Last Digit of a Number

Write a function that returns the last digit of a number.


Simple math operation using modulus.
• Steps for Function:

1. Create a function that takes one number.


2. Return its last digit (using % 10).

You might also like