CS Electrical And Electronics
@cselectricalandelectronics

Kotlin code to perform sum of two numbers using function and return the value?

All QuestionsCategory: KotlinKotlin code to perform sum of two numbers using function and return the value?
chetan shidling asked 3 years ago

I need code with output:
 
fun main(args : Array<String>){
var result = add(41,22)
println(“The sum is : $result”)
}
fun add(num1 : Int, num2 : Int):Int{
return num1 + num2
}
 
Output:
 
The sum is : 63