Sunidhi Bansal has Published 1085 Articles

Print prime numbers from 1 to N in reverse order

Sunidhi Bansal

Sunidhi Bansal

Updated on 21-Feb-2025 16:29:18

2K+ Views

In this article, we will learn how to print prime numbers from 1 to N in reverse order. A prime number is a number greater than 1 that has no positive divisors other than 1 and itself. Our goal is to find all prime numbers in the given range from ... Read More

Last element of vector in C++ (Accessing and updating)

Sunidhi Bansal

Sunidhi Bansal

Updated on 21-Feb-2025 16:28:57

951 Views

In this article, we will learn how to access and update the last element of a vector in C++. A vector in C++ is a dynamic array that can adjust its size automatically, allowing us to store and manage a collection of elements. Sometimes, we need to access or update ... Read More

Program for Fibonacci numbers in PL/SQL

Sunidhi Bansal

Sunidhi Bansal

Updated on 24-Dec-2024 17:56:51

12K+ Views

Given ‘n’ numbers the task is to generate the Fibonacci numbers in PL/SQL starting from 0 to n, where the Fibonacci series of integers is in the form 0, 1, 1, 2, 3, 5, 8, 13, 21, 34 Where integers 0 (1st place) and 1 (2nd place) will have a fixed ... Read More

Count set bits in an integer in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 11-Dec-2024 09:52:15

5K+ Views

We are given an integer number let’s say, num and the task is to first calculate the binary digit of a number and then calculate the total set bits of a number. Set bits in a binary number are represented by 1. Whenever we calculate the binary number of an ... Read More

Program for Point of Intersection of Two Lines in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 02-Dec-2024 00:24:08

4K+ Views

Given points A and B corresponding to line AB and points P and Q corresponding to line PQ; the task is to find the point of intersection between these two lines. Note − The points are given in 2D plane on X and Y coordinates. Here A(a1, a2), B(b1, ... Read More

Count the number of objects using Static member function in C++ Program

Sunidhi Bansal

Sunidhi Bansal

Updated on 02-Dec-2024 00:23:52

2K+ Views

The goal here is to count the number of objects of a class that are being created using a static member function. A static data member is shared by all objects of the class commonly. If no value is given, a static data member is always initialized with 0. A ... Read More

Java program to convert Byte array to IP Address

Sunidhi Bansal

Sunidhi Bansal

Updated on 24-Sep-2024 21:44:00

1K+ Views

In this article, we will learn to convert a byte array into an IP address using the IPAddress class in Java. This program takes a series of bytes, representing an IP address in binary form, and converts them into a standard dot-separated string representation of an IP address. We'll go through ... Read More

C++ Program to check if input is an integer or a string

Sunidhi Bansal

Sunidhi Bansal

Updated on 02-Nov-2023 13:08:18

43K+ Views

Given with an input by the user and the task is to check whether the given input is an integer or a string. Integer can be any combination of digits between 0 -9 and string can be any combination excluding 0 – 9. Example Input-: 123 Output-: 123 is an ... Read More

Read/Write Class Objects from/to File in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 05-Oct-2023 01:10:37

39K+ Views

The iostream standard library has two methods cin, to accept input from standard input stream and cout to print output to the standard output stream. In this article we will learn how to read data from files into class objects and how to write data in class objects to files.Reading ... Read More

System() Function in C/C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 06-Sep-2023 21:57:43

37K+ Views

Given the task is to show the working of system() in C/C++.The system() function is a part of the C/C++ standard library. It is used to pass the commands that can be executed in the command processor or the terminal of the operating system, and finally returns the command after ... Read More

1 2 3 4 5 ... 109 Next
Advertisements