Solve Me First

Complete the function solveMeFirst to compute the sum of two integers.
Function prototype:
int solveMeFirst(int a, int b);
where,
  • a is the first integer input.
  • b is the second integer input
Return values
  • sum of the above two integers
Sample Input
a = 2
b = 3
Sample Output
5
Explanation
The sum of the two integers  and  is computed as: .

php

<?php

function solveMeFirst($a,$b){
// Hint: Type return $a + $b; below
return $a + $b;
}

$handle = fopen ("php://stdin","r");
$_a = fgets($handle);
$_b = fgets($handle);
$sum = solveMeFirst((int)$_a,(int)$_b);
print ($sum);
fclose($handle);
?>

Comments

Popular posts from this blog

Intro to Tutorial Challenges

Strong Password