We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4
Name - Sanjay Nithin S
Reg No. - 20BIT0150
2. Write a multithreading program to get the maximum limit from the user to find the sum of odd and even numbers. Create a thread to find the even numbers from 1 to the maxlimit and get the summation. Similarly create another thread to find the odd numbers from 1 to maxlimit and get the summation. In the main thread the summation of both the odd sum and even sum should be calculated.
Code: import java.util.Scanner; class newFie { int x =0; int evensum = 0; int oddsum = 0; static int N;