Nishu Kumari has Published 83 Articles

C++ Program to Calculate Sum of Natural Numbers

Nishu Kumari

Nishu Kumari

Updated on 09-May-2025 15:31:03

3K+ Views

In this article, we will write a C++ program to calculate the sum of the first n natural numbers. Natural numbers are positive numbers starting from 1(i.e., 1, 2, 3, ...). We will take a positive number n as input and find the sum of all natural numbers from ... Read More

C++ Program to Find Factorial

Nishu Kumari

Nishu Kumari

Updated on 09-May-2025 15:30:29

23K+ Views

In this article, we'll show you how to write a C++ program to find the factorial of a number. The factorial of a number is the result of multiplying all the positive integers from 1 to that number. It is written as n! and is commonly used in mathematics ... Read More

C++ Program to Find LCM

Nishu Kumari

Nishu Kumari

Updated on 09-May-2025 15:28:41

10K+ Views

In this article, we'll show you how to find the LCM of two numbers in a C++ program. The LCM(Least Common Multiple) is the smallest positive number that is exactly divisible by both numbers. For example, if we take 4 and 5: The multiples of 4 are: 4, ... Read More

C++ Program to Reverse a Number

Nishu Kumari

Nishu Kumari

Updated on 09-May-2025 15:18:28

1K+ Views

In this article, we will show you how to reverse a number using C++. Reversing a number means changing the order of its digits, so the first digit moves to the end, the last digit moves to the front, and the middle digits follow in the opposite order. For ... Read More

C++ Program to Calculate Power of a Number

Nishu Kumari

Nishu Kumari

Updated on 09-May-2025 15:17:36

6K+ Views

In this article, we'll show you how to calculate the power of a number in C++. Calculating a power means multiplying the base by itself as many times as the exponent indicates. For example, 2 raised to the power of 3 (2^3) means multiplying 2 by itself three times: ... Read More

C++ Program to Check Whether a character is Vowel or Consonant

Nishu Kumari

Nishu Kumari

Updated on 09-May-2025 15:16:30

12K+ Views

In this article, we'll show you how to write a C++ program to check if a given character is a vowel or a consonant. Vowels are the letters 'a', 'e', 'i', 'o', 'u'(both uppercase and lowercase), and all other alphabetic characters are consonants. For example, if we input ... Read More

C/C++ Pointers vs Java references

Nishu Kumari

Nishu Kumari

Updated on 09-May-2025 11:34:00

2K+ Views

In this article, we will show you the difference between C/C++ pointers and Java references. C/C++ use pointers to manually control how memory is used and accessed. Java, on the other hand, does not support pointers and uses references instead, which manage memory automatically. ... Read More

C++ Program to Find Largest Element of an Array

Nishu Kumari

Nishu Kumari

Updated on 09-May-2025 11:31:59

7K+ Views

In this article, we'll show you how to write a C++ program to find the largest element in an array. An array is a collection of values that share the same data type. Our task is to go through all the elements stored in ... Read More

C++ Program to Implement Heap Sort

Nishu Kumari

Nishu Kumari

Updated on 17-Apr-2025 16:55:01

858 Views

The Heap Sort is a comparison-based sorting algorithm that sorts the numbers using a binary heap. It is an in-place sorting method, that means it sorts the array without needing any extra space. In this article, we have been given an unsorted array and our task is to implement ... Read More

How to deallocate a 2D array in C++

Nishu Kumari

Nishu Kumari

Updated on 08-Apr-2025 11:15:34

121 Views

In this article, we will learn how to deallocate a 2D array in C++. A 2D array is an array of arrays, where each element points to another array. When you dynamically allocate a 2D array, memory is reserved for each row and the main array on the heap. Deallocating ... Read More

Previous 1 ... 3 4 5 6 7 ... 9 Next
Advertisements