![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 9326 Articles for Object Oriented Programming
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
623 Views
In this article, we will understand how to print left triangle star pattern. The pattern is formed by using multiple for-loops and print statements.Below is a demonstration of the same −InputSuppose our input is −Enter the number of rows : 8OutputThe desired output would be −The right triangle star pattern : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *AlgorithmStep 1 - START Step 2 - Declare three integer values namely i, j ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
608 Views
In this article, we will understand how to print left triangle star pattern. The pattern is formed by using multiple for-loops and print statements.Below is a demonstration of the same −InputSuppose our input is −Enter the number of rows : 8OutputThe desired output would be −* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *AlgorithmStep 1 - START Step 2 - Declare three integer values namely i, j and my_input Step 3 - Read ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
9K+ Views
Prime numbers are special numbers with only two factors 1 and that number itself, they cannot be divided by any other number. Therefore, to check whether a given number is prime or not, first, we will divide the given number by all natural numbers less than or equal to it and then, we check the number of factors. If the count of factors is only two then, the given number is prime otherwise not. This way of checking prime numbers is called as factorization. Now, let's understand how we can identify if a given number is prime or not by ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
2K+ Views
An anagram is a word or phrase formed by rearranging the letters of two or more words. Hence, the logic to check whether two given strings are anagram or not is as follows: Suppose there are two strings, if both strings contain the same set of letters along with the same number of letters regardless of their order, then we can say that both strings are anagram otherwise not. Now, let's understand how we can implement this logic in our Java programs to find if two strings are anagram or not. Problem Statement Before jumping to the Java programs to ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
9K+ Views
In number theory, an Armstrong number is a pattern based number whose sum of each digit raised to the power of total number of digits is equal to the given number itself. Hence, to check whether a number is an Armstrong or not, first, determine the total number of digits and assume it 'n'. Then separate each digit and raise them to the power of 'n'. In the last step, calculate the power of each digit and add all of them. If the sum we get is equal to the original number, then it is an Armstrong number otherwise not. ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
923 Views
In this article, we will understand how to check if an array contains the given value. This is accomplished by iterating upon the array elements and comparing the given input with the array elements.Below is a demonstration of the same −InputSuppose our input is −Enter the number to be searched: 25 The elements in the integer array: 15 20 25 30 35OutputThe desired output would be −The array contains the given value AlgorithmStep 1 - START Step 2 - Declare three integer values namely my_input , i, array_size. A Boolean value my_check is defined and an integer array my_array is defined ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
580 Views
Whether the specified number is positive or negative can be defined with respect to 0. A number greater than 0 is considered a positive number whereas a number less than 0 is considered a negative number. To check whether a given number is positive or negative in Java, we can use Java conditional statements like if-else blocks or ternary operators. In this article, we are going to explore the mentioned ways to identify if a number is positive or negative with the help of Java programs. Java Program to Check Whether a Number is Positive or Negative In this ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
565 Views
In this article, we will understand how to check whether a number is even or odd. This is accomplished by checking if the given number is divisible by 2.Below is a demonstration of the same −InputSuppose our input is −Enter the number : 45OutputThe desired output would be −The number 45 is an odd number AlgorithmStep 1 - START Step 2 - Declare an integer values namely my_input. Step 3 - Read the required values from the user/ define the values Step 4 - Use the modulus operator and compute my_input % 2 value. Step 5 - If the result is 0, ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
394 Views
In this article, we will understand how to find sum of N numbers using recursion. A recursive function is a function that calls itself multiple times until a particular condition is satisfied.Recursion is the process of repeating items in a self-similar way. In programming languages, if a program allows you to call a function inside the same function, then it is called a recursive call of the function.Many programming languages implement recursion by means of stacks. Generally, whenever a function (caller) calls another function (callee) or itself as callee, the caller function transfers execution control to the callee. This transfer ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
488 Views
In this article, we will understand how to find the product of two numbers using recursion. A recursive function is a function that calls itself multiple times until a particular condition is satisfied.Recursion is the process of repeating items in a self-similar way. In programming languages, if a program allows you to call a function inside the same function, then it is called a recursive call of the function.Many programming languages implement recursion by means of stacks. Generally, whenever a function (caller) calls another function (callee) or itself as callee, the caller function transfers execution control to the callee. This ... Read More