CoderMantra

Menu
  • Home
  • Quiz
  • How-To
  • Q/A
  • Blog

Tag: java practice question

A program in Java to display the first 50 pentagonal numbers.

April 7, 2023
| No Comments
| Assignments, Java-Assignments, Practice Questions

In the above Java program to display the first 50 pentagonal numbers, we first need to understand what is pentagon? A pentagonal number is a figurative number that extends the concept of triangular and square numbers to the pentagon, but, unlike the first two, the patterns involved in the construction of pentagonal numbers are not…

Read More »

Java program to count all vowels in a string.

April 7, 2023
| No Comments
| Assignments, Java-Assignments, Practice Questions

In the above Java program to count all vowels in a string we use built-in function count() and with the help of a counter variable, calculate each and every vowel. Sample Output: Input the string: welcome To the world of java Number of Vowels in the string: 9

Read More »

Java program to display the pattern in a right angled triangle with a number.

April 7, 2023
| No Comments
| Assignments, Java-Assignments, Practice Questions

In the above Java program to print a right angles triangle from a number, we have use nested loop where i is row and j is column in that row. Sample Output: Input number of rows : 10 1 12 123 1234 12345 123456 1234567 12345678 123456789 12345678910

Read More »

  • 2 of 2
  • « Previous
  • 1
  • 2

java practice question

  • Java program to display the pattern in a right angled triangle with a number.
  • Java program to count all vowels in a string.
  • A program in Java to display the first 50 pentagonal numbers.
  • A program in Java to check whether a string is a valid password or not.
  • Java program to display the current date and time.
  • Java Program to sort an array using Merge sort .
  • A program in Java to replace all the vowels in a string with a specified character.
  • A program in Java to convert a Roman number to an integer number.
  • A program in Java to calculate the average value of array elements.
  • A program in Java to check if a file or directory has read and write permission or not.
  • A program that accepts an employee’s ID, total worked hours in a month and the amount he received per hour. Print the ID and salary (with two decimal places) of the employee for a particular month.
About CoderMantra

Coder Mantra is a unique e-learning website, offers a tutorial of different popular programming languages with examples. The code on this popular tutorial website is tested and executed.

Latest Posts
Double Linked List in Java. July 15, 2025
Simple Calculator Program in Python April 25, 2025
Number Guessing Game in Python April 25, 2025
Python Program to Swap Two Variables April 14, 2025
Contact Us

info@codermantra.com

admin@codermantra.com

© 2020 Coder Mantra . All Rights Reserved
About | Privacy Policy | Terms | Contact