Exercise 1: Function To Check Sum
Let's write a function that computes and returns the sum of integers using the pass by value method.
We'll cover the following
Problem Statement
In this exercise, you have to write a function checkSum
that takes two integers num1
and num2
, calculates their sum and generates the results after comparing the sum with 100
. If:
The sum is less than
100
; it prints sum is less than 100.The sum is greater than
100
; it prints sum is greater than 100.The sum is equal to
100
; it prints sum is equal to 100.
Sample input
Create a free account to access the full course.
By signing up, you agree to Educative's Terms of Service and Privacy Policy