# Recent posts tagged numbers

6 0 4 min.
Hello reader, Welcome to my post :)In this particular post, we shall discuss how we can swap two numbers without using a third temporary variable. We know that in order to swap two numbers, we can make use of a temporary variable, store the first num...
0 0 1 min.
Find maximum and minimum numbers in an array in javaMaximum: We will find the highest number in an arrayMinimum: We will find the lowest number in an arrayimport java.util.Arrays; public class kodlogs { static int maximum; static int mini...
0 0 2 min.
There are so many solutions to this problem. You can check this by using the regular expressions or the ASCII codes but the simplest yet easiest way to do this is by using isLetter() and isDigit() methods in Java.isLetter():This method is defined in ...
21 2 1 min.
Here, we study about swapping of two numbers without using third variable.We can swap two numbers without using third variable. There are two common ways to swap two numbers without using third variable:By + and -By * and /Program 1: Using + and...
6 0 3 min.
How to generate random numbers c++ Using the random number generator to choose prizes for usersYou can easily imitate dice rolling by using a random number generator.Let's say you are organizing a prize giveaway for your ...
8 0 1 min.
Display prime numbers between two intervals#include <stdio.h> int main() { int low, high, i, flag; printf("Enter two numbers(intervals): "); scanf("%d %d", &low, &high); printf("Prime numbers between %d and %d are: ", low, ...
0 0 2 min.
Utilize the DCount capacity to include the quantity of records in a space when you don't have to know their specific qualities. Albeit the expr contention can play out a computation on a field, the DCount work essentially counts the quantity of r...
0 0 1 min.
In Java, to find the square root of a number is very easy if we are using the pre-defined method. Java Math class provides sqrt() method to find the square root of a number. In this section, we will create a Java pr...
0 0 1 min.
The Algorithm:To reverse a number, follow the steps given below:First, we find the remainder of the given number by using the modulo (%) operator.Multiply the variable reverse by 10 and add the remainder into it.Divide the number by 10.Repeat the abo...
0 0 3 min.
There are times when it is necessary to use random numbers and in Java we have 2 easy ways to obtain it either with Math.random or with java.util.Random which offers us some more possibilities although its use is just as simple.MATH.RANDOM ():If you ...
0 0 1 min.
In this article, we will see How to generate random numbers in Javarandom numbers within a certain range of the integer, float, double, long, and boolean can be generated in Java.There are three methods to generate random numbers in Java.Method 1: Us...
0 0 1 min.
Squaring any number in mathematics is pretty simple and in C++ it is similar. We can calculate the square of any number by multiplying it by itself. And that's it, that is all for today. How to calculate the square of any number in c++? ...
2 0 1 min.
In this article, we are going to learn how to create random numbers between 1 and 10 in C++? Solution Assign the first number to be 1 and last number to 100Calling function randResult The function rand will give us a value of 0 to...
10 0 1 min.
In this article, we are going to learn how to create random numbers between 1 and 100 in C++? Solution Assign the first number to be 1 and last number to 100Calling function randResult The function rand will give us a value of 0 to ran...
0 0 2 min.
#include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main() { int no_of_numbers = 100; int first_number = 1; std::srand(std::time(0)); int random = std::rand() % no_of_numbers + ...
19 1 1 min.
Hi, I am new to this world of programming in java language. You might feel to check if a character is a number in java? I mean what is the best way to do it?Solution:I'm not sure if this is the best option or not, But this seems pretty simpl...
To see more, click for the full list of questions or popular tags.