Implement Stack using Linked List in C++

In this post we will write a program to implement Stack using Linked List. Let’s first understand what is a Stack: Stack: A stack is an abstract data type that serves as a collection of elements, with two principal operations: push, which adds an element to the collection, and pop, which removes the most recently … Read more

Program to find reverse number in C++

In this post we will understand the logic to find the reverse number of a given number, then we will implement the  same in C++ programming language. Let’s understand the logic: Programming Logic: Input a number from the user. The while loop is used until n != 0 is false (0). In each iteration of the loop, the … Read more

Display current Date and Time in C++

To show Date and Time in a C++ program we have used the “localtime()” function. Calculation of day, month and year is explained within the program itself.   Program to display current Date and Time C++: #include <iostream> #include <time.h> using namespace std; time_t theTime = time(NULL); struct tm *aTime = localtime(&theTime); int day = … Read more

Program to Find Armstrong Number C++

Here we write a program to find whether the given number is Armstrong number C++ or not. First let’s start understand what is Armstrong number also known as Narcissistic number ? What is Armstrong number: A number is Armstrong if the sum of cubes of individual digits of a number is equal to the number … Read more