29 solutions available
Question 1What are looping control structures?
Question 2What are the essential parts of a looping control structure?
Question 3How are these statements different from each other:(i) break(ii) continue(iii) System.exit(0)
Question 4(i)Identify all the errors in the following repetitive statements.for (int i = 5; i > 0; i++) { System.out.println("Java"); }
Question 5What is an empty statement? Explain its usefulness.
Question 7What are the differences between while loop and do-while loop?
Question 8(i)How many times are the following loop bodies repeated? What is the final output in each case?int x = 1; while (x < 10) if(x % 2...
Question 8(ii)How many times are the following loop bodies repeated? What is the final output in each case?int y = 1; while (y < 10) if (y % 2...
Question 8(iii)How many times are the following loop bodies repeated? What is the final output in each case?int z = 1; while (z < 10) if((z++)...
Question 9Write a program to accept n number of input integers and find out:i. Number of positive numbersii. Number of negative numbersiii. Sum of...
Question 10Write a program using do-while loop to compute the sum of the first 50 positive odd integers.
Question 11Write a program to read the number n via the Scanner class and print the Tribonacci series:0, 0, 1, 1, 2, 4, 7, 13, 24, 44, 81 ...and so...
Question 12Write a program to calculate the value of Pi with the help of the following series:Pi = (4/1) - (4/3) + (4/5) - (4/7) + (4/9) - (4/11) +...
Question 13Write a menu-driven program to display the pattern as per user's choice:Pattern 1 Pattern 2ABCDE BABCD LLABC...
Question 14Write a program to input a number and check and print whether it is a Pronic number or not. (Pronic number is a number which is the...
Question 15Write a program to accept a number and check and display whether it is a spy number or not. (A number is spy if the sum of its digits...
Question 16Write a program to accept a number and check and display whether it is a Niven number or not. (Niven number is a number which is divisible...
Question 17Using the switch statement, write a menu driven program to:i. Generate and display the first 10 terms of the Fibonacci series 0, 1, 1, 2,...
Question 18Write a program to input a number and print whether the number is a special number or not. (A number is said to be a special number, if...
Question 19Write a menu driven program to accept a number and check and display whether it is a Prime number or not OR an Automorphic Number or not....
Question 20Write a menu driven program to access a number from the user and check whether it is a BUZZ number or to accept any two numbers and to...
Question 21(i)Write a program in Java to find the sum of the given series:x1 + x2 + x3 + x4 ... + xnimport java.util.Scanner; public class...
Question 21(ii)Write a program in Java to find the sum of the given series:x1 - x2 + x3 - x4 ... - xn , where x = 3
Question 21(iii)Write a program in Java to find the sum of the given series:1/x1 + 2/x2 + 3/x3 + ... + n/xn
Question 21(iv)Write a program in Java to find the sum of the given series:1/2 + 2/3 + 3/4 + ... + 49/50
Question 21(v)Write a program in Java to find the sum of the given series:1/√1 + 2/√2 + 3/√3 + ... + 10/√10
Question 5How many times will the following code print "Hello"?for (int i = 1; i <= 5; i++); { System.out.println("Hello"); }0154
Question 6What will be the output of the following code?public static void main(String args[]) { int sum = 0; for (int i= 1; i <= 5; i++)...
Question 8How many times will the following loop execute?public static void main(String args[]) { int i = 1; while (i < 10) if...