Monday 1 November 2021

Solve Me First || HackerRank C Programming Solution

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

Example

Return .

Function Description

Complete the solveMeFirst function in the editor below.

solveMeFirst has the following parameters:

  • int a: the first value
  • int b: the second value

Returns
int: the sum of  and 

Constraints

Sample Input

a = 2

b = 3

Sample Output

5

Explanation

.

Solution:

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>

int solveMeFirst(int a, int b)
{
    int sum;
    sum=a+b;
    return sum;
}
int main()
{
    int num1,num2;
    scanf("%d %d",&num1,&num2);
    int sum; 
    sum = solveMeFirst(num1,num2);
    printf("%d",sum);
    return 0;
}

No comments:

Post a Comment

If you have any doubts, Please let me know....

Latest

Question 3: Wire {HDLBits-Verilog-Solutions}

  Welcome to  HDLBits -Verilog-Solutions ! --------------------------------------------------------------------------- Question 3:   Create ...

Popular Posts