Samual Sam has Published 2310 Articles

How can we read Python dictionary using C++?

Samual Sam

Samual Sam

Updated on 28-Aug-2025 09:29:08

542 Views

A dictionary in Python is a collection of key-value pairs where each key must be unique. The lists, which are indexed by numbers, are accessed using keys that can be immutable types, strings, numbers, or tuples. Lists cannot be used as keys because they can be modified. Dictionaries are created ... Read More

Program to check if a number is Positive, Negative, Odd, Even, Zero?

Samual Sam

Samual Sam

Updated on 17-Jun-2025 15:57:24

7K+ Views

In this article, we are going to learn how to check if the number is positive, negative, odd, even, or zero. Identifying and categorizing a number based on its characteristics is a basic operation. A number can fall into multiple categories: Positive: A number is greater ... Read More

Decimal type in C#

Samual Sam

Samual Sam

Updated on 05-Jun-2025 09:58:40

2K+ Views

The decimal type is a value type and has the plus, minus, multiply and divide operators. Firstly, set two decimal values − decimal d1 = 5.8M; decimal d2 = 3.2M; To add decimals − d1 = d1 + d2; Let us see an example to add two decimal values − ... Read More

How to clear console in C?

Samual Sam

Samual Sam

Updated on 14-Apr-2025 19:13:13

21K+ Views

In C, we have various methods to clear the console or output screen and one of them is clrscr() function. It clears the screen as function invokes. It is declared in "conio.h" header file. There are some other methods too like system (cls) and system ("clear") and these are declared ... Read More

What is the size of an object of an empty class in C++?

Samual Sam

Samual Sam

Updated on 11-Apr-2025 17:17:28

367 Views

The size of an object of an empty class in C++ is 1 byte as it allocates one unique address to the object in the memory. The size can not be 0, as the two objects can not have same memory allocation. In this article, we will see an example ... Read More

Java NumberFormat.getPercentageInstance() Method

Samual Sam

Samual Sam

Updated on 28-Jan-2025 14:58:02

611 Views

In this article, we will learn the NumberFormat.getPercentageInstance() method. Java provides powerful tools for formatting numbers, currencies, and percentages through the java.text.NumberFormatclass. One of the most useful methods in this class is the getPercentageInstance() method. NumberFormat.getPercentageInstance() method The NumberFormat.getPercentageInstance() method is a static method that returns a NumberFormat instance configured ... Read More

Java program to convert binary number to decimal number

Samual Sam

Samual Sam

Updated on 28-Jan-2025 14:51:45

867 Views

In this article, we will learn to convert a binary number into a decimal number in Java.Binary numbers are fundamental in computer science and digital electronics, where data is represented in a base-2 numeral system consisting of only 0s and 1s. Converting binary numbers to their decimal equivalents is a ... Read More

Java Program to Compare Strings

Samual Sam

Samual Sam

Updated on 23-Jan-2025 22:54:05

6K+ Views

In this article, we will compare two Strings in Java using the compareTo() method, equals() method, or == operator. Each approach serves a specific purpose in comparing strings, whether it's lexicographical comparison, checking for content equality, or comparing object references. Using the compareTo() methodThe ... Read More

Java Program to replace all occurrences of given String with new one

Samual Sam

Samual Sam

Updated on 23-Jan-2025 22:53:32

322 Views

In this article, we will learn how to replace all occurrences of a given string with a new one using the replaceAll() method in Java. This method is particularly useful when we want to modify specific parts of a string.   replaceAll() method The replaceAll() method in Java is used ... Read More

Java Program to copy all the key-value pairs from one Map into another

Samual Sam

Samual Sam

Updated on 26-Dec-2024 20:45:48

631 Views

In Java, maps are a powerful and versatile way to store key-value pairs. Often, you may find the need to merge the contents of one map into another. This can be done effortlessly using the putAll method available in the Map interface. Let's explore this functionality with an example and ... Read More

1 2 3 4 5 ... 231 Next
Advertisements