Wednesday, 4 October 2017

solve me first




problem-


Welcome to HackerRank! The purpose of this challenge is to familiarize you with reading input from stdin (the standard input stream) and writing output to stdout (the standard output stream) using our environment.
Review the code provided in the editor below, then complete the solveMeFirst function so that it returns the sum of two integers read from stdin. Take some time to understand this code so you're prepared to write it yourself in future challenges.
Select a language below, and start coding!
Input Format
Code that reads input from stdin is provided for you in the editor. There are  lines of input, and each line contains a single integer.
Output Format
Code that prints the sum calculated and returned by solveMeFirst is provided for you in the editor.

solution-
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
/*
    *
    * Ratnadeep Sen
    * National Institute Of Technology Silchar (NITS)
    *
*/
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);   
}



No comments:

Post a Comment

Between two sets

problem- Consider two sets of positive integers,   and  . We say that a positive integer,  , is  between  sets   and   if the followi...