Algorithm


Problem link https://www.codechef.com/problems/FLOW001 

Problem

Your task is very simple: given two integers  and , write a program to add these two numbers and output the sum.

Input Format

  • The first line contains an integer , the total number of test cases.
  • Then follow  lines, each line contains two integers,  and .

Output Format

For each test case, add  and  and display the sum in a new line.

Constraints

  • 1≤�≤1000
  • 0≤�,�≤10000

Sample 1:

Input
 
Output
 
3
1 2
100 200
10 40
3
300
50

Explanation:

Testcase 1: 1+2=3. Hence the first output is 3.

Testcase 2: 100+200=300. Hence the second output is 300.

 

Code Examples

#1 Code Example with C Programming

Code - C Programming

#include<stdio.h>
int main()
{
    int t,a,b;
    scanf("%d",&t);
    while(t--)
    {
        scanf("%d %d",&a,&b);
        printf("%d\n",a+b);
    }
}
Copy The Code & Try With Live Editor

Input

x
+
cmd
3
1 2
100 200
10 40

Output

x
+
cmd
3
300
50

Demonstration


Code shape solution  FLOW00 Add Two Numbers in C,C++

Previous
CodeChef Solution - GDTURN-Good Turn
Next
CodeChef solution AGELIMIT - Age Limit Codechef solution in C, C++, Java