Exercise 1: Function To Check Sum
Write a function that computes and returns the sum of integers using the pass by value method.
We'll cover the following
Problem statement
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 than100
.If the sum is greater than
100
; it prints sum is greater than100
.If the sum is equal to
100
; it prints sum is equal to100
.
Sample input
Create a free account to access the full course.
Continue your learning journey with a 14-day free trial.
By signing up, you agree to Educative's Terms of Service and Privacy Policy