Add Two Numbers
All submissions for this problem are available.Shivam is the youngest programmer in the world, he is just 12 years old. Shivam is learning programming and today he is writing his first program.
Program is very simple, Given two integers A and B, write a program to add these two numbers.Input
The first line contains an integer T, total number of test cases. Then follow T lines, each line contains two Integers A and B.Output
Add A and B and display it.Constraints
- 1 ≤ T ≤ 1000
- 1 ≤ A,B ≤ 10000
Example
Input 3 1 2 100 200 10 40 Output 3 300 50
- Solutions#include<stdio.h>
{
int i,T,a[1000],b[1000];
scanf("%d",&T);
for(i=0;i<T;i++)
{scanf("%d %d",&a[i],&b[i]);
}
for(i=0;i<T;i++)
printf("\n %d",a[i]+b[i]);
}
Wednesday, 7 March 2018
Add Two Numbers
Subscribe to:
Post Comments (Atom)
Reverse The Number
Reverse The Number All submissions for this problem are available. If an Integer N , write a program to reverse the given number. ...
-
Reverse The Number All submissions for this problem are available. If an Integer N , write a program to reverse the given number. ...
-
The Lead Game All submissions for this problem are available. The game of billiards involves two players knocking 3 balls around on a ...
-
First and Last Digit All submissions for this problem are available. If Give an integer N . Write a program to obtain the sum of t...
No comments:
Post a Comment