Java loops | Set 1
Submissions: 5323   Accuracy:

36.68%

  Difficulty: School   Marks: 0
*School Problem's Submission isn't counted in score!

For a given N, prints the sum of even and odd integers of the first N natural numbers.

Input:
First line of the input contains an integer T which denotes the number of test cases. Then T test cases follow.  Each test case contains a single line containing N.

Output: 
For each test case, print space separated sums of even and odd integers of the first N natural numbers respectively.

Constraints:
1 <= T< = 200
1<=N<=10000

Example:
Input:

2
1

Output:
0 1
12 9  

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Gaurav Miglani
Author: gaurav miglani


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.