Computer Applications
Write a program using do-while loop to compute the sum of the first 500 positive odd integers.
Related Questions
Write a program to input n number of integers and find out:
i. Number of positive integers
ii. Number of negative integers
iii. Sum of positive numbers
iv. Product of negative numbers
v. Average of positive numbers
Write three different programs using for, while, and do-while loops to find the product of series 3, 9, 12,… 30.
Write a program to convert kilograms to pounds in the following tabular format (1 kilogram is 2.2 pounds):
Kilograms Pounds 1 2.2 2 4.4 20 44.0 What is the output produced by the following code?
int num = 10; while (num > 0) { num = num - 2; if (num == 2) continue; System.out.println(num); } System.out.println("Finished");