Java Coding Questions https://edupoly.in Indepth Training on ReactJS, Angular, Javascript, MERN,MEAN,Python,Java,Devops,AWS Sun, 19 May 2024 12:11:14 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.5 https://edupoly.in/wp-content/uploads/2024/03/edupoly-logo-light-150x150.png Java Coding Questions https://edupoly.in 32 32 Java Practice Questions on Output Statements https://edupoly.in/full-stack-training-in-hyderabad/java-coding-questions/java-practice-questions-on-output-statements/ https://edupoly.in/full-stack-training-in-hyderabad/java-coding-questions/java-practice-questions-on-output-statements/#respond Sun, 19 May 2024 11:58:19 +0000 https://edupoly.in/?p=292 Use System.out.println() to print the following

  1. Write a program to print the following output for the given values a=10,b=20 Output expected is: 10+20=30 10-20=-10 10*20=200 10/20=0 10%20=10
  2. Write a program to print the following for a given value a=3; Output expected: 3*1=3 3*2=6 3*3=9 3*4=12 3*5=15 3*6=18
]]>
https://edupoly.in/full-stack-training-in-hyderabad/java-coding-questions/java-practice-questions-on-output-statements/feed/ 0 292
Java Practice Questions on Operators and Expressions https://edupoly.in/full-stack-training-in-hyderabad/java-coding-questions/java-practice-questions-on-operators-and-expressions/ https://edupoly.in/full-stack-training-in-hyderabad/java-coding-questions/java-practice-questions-on-operators-and-expressions/#respond Sun, 19 May 2024 12:02:51 +0000 https://edupoly.in/?p=295

  1. Given a variable var x = 23. Increment its value by 1.
  2. Print the sum of 12 and 23 using the addition operator.
  3. Print the difference of 52 and 36 using the subtraction operator.
  4. Print the product of 23 and 56 using the multiplication operator.
  5. Divide 36 by 5 and print the output by using the division operator.
  6. Divide 67 by 4 and print the quotient.
  7. Divide 48 by 7 and print the remainder.
  8. Print the value of 2 raised to the power of 6.
  9. Given var x = “Edupoly” and var y = “Training”. Print “Edupoly Training” in the console.
  10. Find the perimeter of a square having each side 4cm.
  11. Find the perimeter of a rectangle of length 50cm and breadth 35cm.
  12. Find the circumference of a circle of radius 20cm. (Take π = 3.14)
  13. Find the area of a square having each side 12cm.
  14. Find the area of a rectangle of length 25cm and breadth 16cm.
  15. Find the area of a circle of radius 3.75cm.
  16. Given the marks of 3 subjects as 67,48 and 74. Print the average marks of the 3 subjects.
  17. Given the cost of a product as ₹538.56, add 18% GST to it and print the total cost.
  18. Given a variable var x = 48. Decrement its value by 1.
  19. Write a script to swap two numbers;
  20. Write a script to swap two numbers without using 3rd variable (please use *,%,/ not + and -)
  21. Write a program to print the reminder of a division
  22. Write a program to print the simple interest rate of given P T R values
  23. Write a program to print the simple interest rate of given P T R values
  24. Write a program to print the max of given two numbers using ternary operator
  25. Write a program to print the max of given three numbers using ternary operator
  26. Find the area of a square for given length of a side
  27. Find the area of a square for given length of a side
  28. Find the area of a rectangle for given length and breadth
  29. Find the area of a triangle for given base and height
  30. Check a given number is even or not using ternary operator
  31. Check a given number is odd or not using ternary operator
  32. Check a given number is positive or not using ternary operator
  33. Check a given number is multiple of 4 or not using ternary operator
  34. Print the (a+b)^2 for given a and b values
  35. Print the (a+b)^3 for given a and b values
  36. Print the (a+b+c)^2 for given a,b and c values
  37. Ramesh’s basic salary is input through the keyboard. His dearness allowance is 40% of basic salary, and house rent allowance is 20% of basic salary. Write a program to calculate his gross salary.
  38. The distance between two cities (in km.) is input through the keyboard. Write a program to convert and print this distance in meters, feet, inches and centimeters.
  39. If the marks obtained by a student in five different subjects are input through the keyboard, find out the aggregate marks and percentage marks obtained by the student. Assume that the maximum marks that can be obtained by a student in each subject is 100.
  40. Temperature of a city in Fahrenheit degrees is input through the keyboard. Write a program to convert this temperature into Centigrade degrees.
  41. The length & breadth of a rectangle and radius of a circle are input through the keyboard. Write a program to calculate the area & perimeter of the rectangle, and the area & circumference of the circle.
  42. Two numbers are input through the keyboard into two locations C and D. Write a program to interchange the contents of C and D.
  43. If a five-digit number is input through the keyboard, write a program to calculate the sum of its digits. (Hint: Use the modulus operator ‘%’)
  44. If a five-digit number is input through the keyboard, write a program to reverse the number.
  45. If a four-digit number is input through the keyboard, write a program to obtain the sum of the first and last digit of this number.
  46. In a town, the percentage of men is 52. The percentage of total literacy is 48. If total percentage of literate men is 35 of the total population, write a program to find the total number 48 Let Us C of illiterate men and women if the population of the town is 80,000.
  47. A cashier has currency notes of denominations 10, 50 and 100. If the amount to be withdrawn is input through the keyboard in hundreds, find the total number of currency notes of each denomination the cashier will have to give to the withdrawer.
  48. If the total selling price of 15 items and the total profit earned on them is input through the keyboard, write a program to find the cost price of one item.
  49. If a five-digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits. For example if the number that is input is 12391 then the output should be displayed as 23402.
  50. Write a program that converts Centigrade to Fahrenheit. Expected Output : Input a temperature (in Centigrade): 45 113.000000 degrees Fahrenheit.
  51. Write a JavaScript program that calculates the volume of a sphere. Expected Output : Input the radius of the sphere : 2.56 The volume of the sphere is 70.276237.
  52. Write a JavaScript program that prints the perimeter of a rectangle to take its height and width as input. Expected Output : Input the height of the Rectangle : 5 Input the width of the Rectangle : 7 Perimeter of the Rectangle is : 24.000000
  53. Write a JavaScript program that converts kilometers per hour to miles per hour. Expected Output : Input kilometers per hour: 15 9.320568 miles per hour
  54. Write a JavaScript program that takes hours and minutes as input, and calculates the total number of minutes. Expected Output : Input hours: 5 Input minutes: 37 Total: 337 minutes.
  55. Write a program in JavaScript that takes minutes as input, and display the total number of hours and minutes. Expected Output : Input minutes: 546 9 Hours, 6 Minutes
  56. Write a program in JavaScript that reads a forename, surname and year of birth and display the names and the year one after another sequentially. Expected Output : Input your firstname: Tom Input your lastname: Davis Input your year of birth: 1982 Tom Davis 1982
  57. Write a program in JavaScript to calculate the sum of three numbers with getting input in one line separated by a comma. Expected Output : Input three numbers separated by comma : 5,10,15 The sum of three numbers : 30
  58. Write a JavaScript program to perform addition, subtraction, multiplication and division of two numbers Expected Output : Input any two numbers separated by comma : 10,5 The sum of the given numbers : 15 The difference of the given numbers : 5 The product of the given numbers : 50 The quotient of the given numbers : 2.000000
  59. Write a JavaScript program to find the third angle of a triangle if two angles are given. Expected Output : Input two angles of triangle separated by comma : 50,70 Third angle of the triangle : 60
  60. Write a script to display the maximum number in given two numbers using operators
  61. Write a script to display the maximum number in given three numbers using operators
  62. Write a script to display the given two strings in ascending order using operators
]]>
https://edupoly.in/full-stack-training-in-hyderabad/java-coding-questions/java-practice-questions-on-operators-and-expressions/feed/ 0 295
Java Practice Questions on if else statements https://edupoly.in/full-stack-training-in-hyderabad/java-coding-questions/java-practice-questions-on-if-else-statements/ https://edupoly.in/full-stack-training-in-hyderabad/java-coding-questions/java-practice-questions-on-if-else-statements/#respond Sun, 19 May 2024 12:06:50 +0000 https://edupoly.in/?p=298

  1. Write a program to check a number is divisible by 7 or not.
  2. Write a program to check a number is factor of 84 or not.
  3. Write a program to check a number is factor of 96 or not.
  4. and if the given number is more Than 96 program should say ‘not a valid input’
  5. Write a program to check a number is multiple of 3 or not.
  6. Write a program to check a number is positive or not.
  7. Write a program to check a number is having 4 at units place (984).
  8. Write a program to check a number is 3 digited number or not.
  9. Write a program to print even or odd for a given number
  10. Write a program to print the greatest number in given two numbers
  11. Write a program to print the least number in given two numbers
  12. Write a program to print the given two numbers in ascending order
  13. Write a program to print the given two numbers in descending order
  14. Write a program to print the greatest number in given three numbers
  15. Write a program to print the least number in given three numbers
  16. Write a program to print the given three numbers in ascending order
  17. Write a program to print the given three numbers in descending order
  18. Write a program to take marks of three subjects and print the grade of student
  19. Character Is Vowel or Consonant
  20. A Character Is an Alphabet or Not
  21. Uppercase, Lowercase, Special Character, or Digit
  22. Leap Year
  23. The Date Is Correct or Not
  24. Voting Eligibility Checker
  25. Check whether a number is negative, positive or zero.
  26. Check whether a number is divisible by 5 and 11 or not.
  27. Input any alphabet and check whether it is vowel or consonant.
  28. Input any character and check whether it is the alphabet, digit or special character.
  29. Check whether a character is an uppercase or lowercase alphabet.
  30. Input week number and print weekday.
  31. Input month number and print number of days in that month.
  32. Count the total number of notes in a given amount.
  33. Input angles of a triangle and check whether the triangle is valid or not.
  34. Check whether the triangle is an equilateral, isosceles or scalene triangle.
]]>
https://edupoly.in/full-stack-training-in-hyderabad/java-coding-questions/java-practice-questions-on-if-else-statements/feed/ 0 298
Java Practice Questions on iteration with while and for loops https://edupoly.in/full-stack-training-in-hyderabad/java-coding-questions/java-practice-questions-on-iteration-with-while-and-for-loops/ https://edupoly.in/full-stack-training-in-hyderabad/java-coding-questions/java-practice-questions-on-iteration-with-while-and-for-loops/#respond Sun, 19 May 2024 12:11:13 +0000 https://edupoly.in/?p=300

  1. Write a program to print 1 to 10 numbers using a while loop
  2. Write a program to print 10 to 1 numbers using a while loop
  3. Write a program to print 5 to 15 numbers using a while loop
  4. Write a program to print 15 to 10 numbers using a while loop
  5. Write a program to print 1 to 10 even numbers using a while loop
  6. Write a program to print 1 to 10 odd numbers using a while loop
  7. Write a program to print first ten multiples of 4 using a while loop (multiples of 4 are 4,8,12,16,20,…..)
  8. Write a program to print multiplication table of 6 using while loop
  9. Print the squares of all numbers from 1 to 10.
  10. Print the cubes of all numbers from 1 to 10.
  11. Write a program to print factors of 24 using while loop (factors of 24 are 1,2,3,4,6,8,12,24)
  12. Write a program to print 1 to 10 numbers using a for loop
  13. Write a program to print 10 to 1 numbers using a for loop
  14. Write a program to print all numbers from 1 to a given number
  15. Write a program to print 1 to 10 even numbers using a for loop
  16. Write a program to print 1 to 10 odd numbers using a for loop
  17. Write a program to print first 10 multiples of 3 using a for loop
  18. Write a program to print multiplication table of 6 using a for loop
  19. Write a program to print all the factors of a given number
  20. a program to read 5 numbers and print the maximum and minimum number
  21. a program to read 5 numbers and print only the even numbers
  22. Print all the digits of a given number
  23. Write a program to print only even digits of a given number The output should be 4,2,6 Ex. Let us take 154256
  24. Write a program to print only odd digits of a given number Ex. Let us take 1542763 The output should be 1,5,7,3
  25. Write a program to print the number at 10’s place
  26. Write a program to print the number at 100’s place
  27. Write a program to print the number at 1000’s place
  28. Write a program to print the number at 10000’s place
  29. Write a program to find the LCM of given two numbers
  30. Write a program to convert an octal number to a decimal
  31. Write a program to print the sum of 1 to 10 ( initialisation of sum variable with 0 )
  32. Write a program to print the average of 1 to 10
  33. Accumulation
  34. Write a program to print the sum of the numbers between the given two numbers
  35. Write a program to print the sum of even numbers between the given two numbers
  36. Write a program to print the sum of odd numbers between the given two numbers
  37. Write a program to print the product of the numbers between 1 to 10 ( initialisation of product variable with 1 )
  38. Write a program to find the product of all odd numbers between 1 and 10.
  39. Write a program to print the nth power of a given number. n can be any positive number. (n=3 r =4 then answer must be 333*3 )
  40. Write a program to print factorial of a given number
  41. Write a program to print the nCr of given ‘n’ and ‘r’
  42. Write a program to print the number of factors of 24 using while loop (number of factors for 24 is 8)
  43. Write a program to print the count of factors of a given number using for loop
  44. Write a program to check a given number is a prime number or not
  45. a program to read 5 numbers and print the sum of all entered numbers
  46. a program to read 5 numbers and print average of n numbers
  47. print Number of Digits in given number.
  48. Write a program to count the number of ‘1’s in a given number.
  49. Write a program to eliminate all 0’s from a given number.
  50. Write a program to print all the digits that are less than 5 in a given number.
  51. Print the greatest digit of a given number(n=1237456 then greatest digit is 7)
  52. sum of all digits of a given number Ex: let us take 19345 is the given number The output should be 22 (1+9+3+4+5)=22
  53. a program to print reverse of digits of a number
  54. print the binary value of 8.
  55. Write a program to convert a binary number into a decimal number
  56. Write a program to check a given number is palindrome number or not
  57. Write a program to check a given number is armstrong number or not Ex:153 is an armstrong number
  58. Write a program to print the fibonacci number series up to a given number Expected output:0 1 1 2 3 5 8 13
  59. Print A Calendar Taking Input From User Using Loop
]]>
https://edupoly.in/full-stack-training-in-hyderabad/java-coding-questions/java-practice-questions-on-iteration-with-while-and-for-loops/feed/ 0 300