Created
February 25, 2022 21:22
-
-
Save jeremiahseun/f84a626b49d6fa6dc4bfbdd37bffc43e to your computer and use it in GitHub Desktop.
Function to find Sum of Squares of any Two Number
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:io' | |
| void main() { | |
| // THE VALUE TO BE USED | |
| late int firstNumber; | |
| late int secondNumber; | |
| late int squareFirst; | |
| late int squareSecond; | |
| late int total; | |
| print("Finding the sum of squares of two numbers"); | |
| // GETTING THE FIRST NUMBER | |
| print("Enter the first number: "); | |
| firstNumber = int.parse(stdin.readLineSync()!); | |
| // GETTING THE SECOND NUMBER | |
| print("Enter the second number: "); | |
| secondNumber = int.parse(stdin.readLineSync()!); | |
| print("Processing..."); | |
| // PEFORMING THE SQAURES OF BOTH NUMBERS | |
| squareFirst = firstNumber*firstNumber; | |
| squareSecond = secondNumber*secondNumber; | |
| // ADDING THE SQUARES AND RETURNING IT TO THE USER | |
| total = squareFirst + squareSecond; | |
| print("The total is $total"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment