HackerRank Solve Me First Solution in C#

Complete the function solveMeFirst to compute the sum of two integers.

Example
a=7
b=3
Return 10.
Function Description
Complete the solveMeFirst function with the following parameters:
  • int a: the first value
  • int b: the second value
Returns
- int: the sum of a and b
Sample Input
a = 2
b = 3
Sample Output
5
Explanation
2+3=5.


HackerRank Solve Me First Solution in C#

using System;
using System.Collections.Generic;
using System.IO;
class Solution {
    static int solveMeFirst(int a, int b) { 
        return a+b;
    }
    static void Main(String[] args) {
        int val1 = Convert.ToInt32(Console.ReadLine());
        int val2 = Convert.ToInt32(Console.ReadLine());
        int sum = solveMeFirst(val1,val2);
        Console.WriteLine(sum);
    }
}      

Post a Comment

0 Comments