Tech Study

Write a Swift program that accept 2 integer values and return true if one of them is 30 or if their sum is 30


I have used Swift for windows 1.9 for debugging purpose. But you can use any Swift programming language compiler as per your availability.

func findandtotaltwenty(num1: Int, num2: Int) -> Bool {
    if num1 + num2 == 30 || num1 == 30 || num2 == 30
        return true
        return false
print(findandtotaltwenty(num1: 10, num2: 30))
print(findandtotaltwenty(num1: 15, num2: 15))
print(findandtotaltwenty(num1: 39, num2: 15))


Python Examples

Introduction: Python Examples are the basic programming concepts of python like python syntax,python data types,,python operators,python if else,python comments etc.. …

Read more

C String Functions

C String Functions perform certain operations, It provides many useful string functions which can come into action. The <string.h> header …

Read more