C++ Program to find the greatest number among three numbers

In this example, You will learn how to find the greatest number among the three numbers in C++. List is :10 20 40 => 40 List is :30 20 10…

Continue Reading C++ Program to find the greatest number among three numbers

C++ Program to display even numbers from 1 to 100

In this Program, You will learn how to display even numbers from 1 to 100 in C++. if(i % 2 == 0) { //statement } Example: How to display even…

Continue Reading C++ Program to display even numbers from 1 to 100

C++ Program to check number is even or odd

In this example, You will learn How to check a number is even or odd in C++. 12 % 2 == 0 14 % 2 == 0 Example: Check number…

Continue Reading C++ Program to check number is even or odd

C++ Program to check the age of a user is eligible for voting or not

In this program, You will learn How to check the Age of a user who is eligible for voting or not in C++. if(age >= 18) { //statement } Example:…

Continue Reading C++ Program to check the age of a user is eligible for voting or not

C++ Program to find the absolute value of long and float numbers

In this program, You will learn how to find the absolute value of long and float numbers in C++. Find absolute in C++ long x=abs(-390090); Example: How to find the…

Continue Reading C++ Program to find the absolute value of long and float numbers

C++ Program to find the square root of a number

In this example, You will learn How to Find Square Root of a Number in C++ by using a predefined library Function ( Math.h). ans = sqrt(num); 4 = sqrt(16);…

Continue Reading C++ Program to find the square root of a number

C++ Program to add two numbers

In this Example, You will learn how to Add Two numbers in C++. 20 = 10 + 10 40 = 20 + 20 Example: How to Add Two numbers in…

C++ Program to convert float to integer without type casting

In this program, You will learn how to convert float to integer without type casting in C++. float x = 90.6f; float to int :91 Example: How to convert float…

Continue Reading C++ Program to convert float to integer without type casting

C++ Program to use Different Formats of type casting and display the converted values

In this program, You will learn how to use Different Formats of type casting and display the converted values in C++. int x = 10; char ch = char(x); Example:…

Continue Reading C++ Program to use Different Formats of type casting and display the converted values

C++ Program using const variable

In this Program, You will learn How to implement const variable in C++. const int z = 10; Example: How to Implement a const variable in C++. #include<iostream> using namespace…

Continue Reading C++ Program using const variable