title: Swift - Code using closure to find sum of two numbers with the given code
body: <p>//Write a program using two <code>Int</code> <code>numbers(num1 and num2)</code> and returns sum of those numbers//</p>
  
  <p>given and disabled code:</p>
  
  <pre><code>import Foundation//given and disabled
  
  // Write your code here.(I have to write my code here so that it gives 10 is 5 5 is given as input at run time)
  
   //my code 
  let closure: (Int,Int) -&gt; (Int) = {
  return $0 + $1
  }
  
  //below code is given code and disabled.
  
  let fileName = ProcessInfo.processInfo.environment["OUTPUT_PATH"]!
  FileManager.default.createFile(atPath: fileName, contents: nil, attributes: nil)
  
  let fileHandle = FileHandle(forWritingAtPath: fileName)!
  guard let number1 = Int((readLine()?.trimmingCharacters(in: .whitespacesAndNewlines))!)
  
  else { fatalError("Bad input") }
  
  guard let number2 = Int((readLine()?.trimmingCharacters(in: .whitespacesAndNewlines))!)
  
  else { fatalError("Bad input") }
  
  let res = let closure(number1: number1, number2: number2)
  
  fileHandle.write(String(res).data(using: .utf8)!)
  
  fileHandle.write("\n".data(using: .utf8)!)
  </code></pre>
  
  <p>now when I write my code it is giving compile error in disabled code . Please help.</p>