Question: Given the below program skeleton, insert code where it says such that the program prints the sum of odd integers from 1 to num. You
- Given the below program skeleton, insert code where it says such that the program prints the sum of odd integers from 1 to num. You are not required to perform input validation.
![public class SumOdd Ints ( public static void main (String[] args) { Scanner stdIn - new Scanner (System.in);](https://dsd5zvtm8ll6.cloudfront.net/images/question_images/1704/7/8/0/256659ce1e0435521704780254245.jpg)
public class SumOdd Ints ( public static void main(String[] args) { Scanner stdIn - new Scanner(System.in); int num, sum; System.out.print("Enter a positive odd number: "); num= stdin.nextInt (); System.out.println("Sum - " + sum); } // end main } // end class SumOdd Ints Sample session: Enter a positive odd number: 9 Sum - 25
Step by Step Solution
3.43 Rating (153 Votes )
There are 3 Steps involved in it
To calculate the sum of odd integers from 1 to the number num entered by the us... View full answer
Get step-by-step solutions from verified subject matter experts
