Karthikeya Boyini has Published 2383 Articles

C++ Program to Find LCM

karthikeya Boyini

karthikeya Boyini

Updated on 24-Jun-2020 07:30:56

10K+ Views

The Least Common Multiple (LCM) of two numbers is the smallest number that is a multiple of both.For example: Let’s say we have the following two numbers: 15 and 9.15 = 5 * 3 9 = 3 * 3So, the LCM of 15 and 9 is 45.A program to find ... Read More

C++ Program to Calculate Power of a Number

karthikeya Boyini

karthikeya Boyini

Updated on 24-Jun-2020 07:29:27

5K+ Views

The power of a number can be calculated as x^y where x is the number and y is its power.For example.Let’s say, x = 2 and y = 10    x^y =1024    Here, x^y is 2^10 Power of a number can be calculated using recursive and non-recursive programs. Each ... Read More

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

karthikeya Boyini

karthikeya Boyini

Updated on 24-Jun-2020 07:23:44

10K+ Views

Vowels are the alphabets a, e, i, o, u. All the rest of the alphabets are known as consonants.The program to check if a character is a vowel or consonant is as follows −Example Live Demo#include using namespace std; int main() {    char c = 'a';    if (c ... Read More

C++ Program to Display Factors of a Number

karthikeya Boyini

karthikeya Boyini

Updated on 23-Jun-2020 16:38:25

10K+ Views

Factors are those numbers that are multiplied to get a number.For example: 5 and 3 are factors of 15 as 5*3=15. Similarly other factors of 15 are 1 and 15 as 15*1=15.The program to display the factors of a number are given as follows.Example Live Demo#include using namespace std; int main() ... Read More

C++ Program to Print Number Entered by User

karthikeya Boyini

karthikeya Boyini

Updated on 23-Jun-2020 16:36:19

4K+ Views

The objects “cin” and “cout” are used in C++ for input and output respectively. cin is an instance of the istream class and is attached to the standard input device such as the keyboard. cout is an instance of the ostream class and is connected to the standard output device ... Read More

C++ Program to Add Two Numbers

karthikeya Boyini

karthikeya Boyini

Updated on 23-Jun-2020 16:34:18

12K+ Views

Addition is a basic arithmetic operation. The program to add two numbers performs addition of two numbers and prints their sum on screen.A program that demonstrates addition of two numbers is given as follows −Example Live Demo#include using namespace std; int main() {    int num1=15 ,num2=10, sum;    sum ... Read More

C++ Program to find size of int, float, double and char in Your System

karthikeya Boyini

karthikeya Boyini

Updated on 23-Jun-2020 16:27:53

3K+ Views

Data Types in C++There are many data types in C++ but the most frequently used are int, float, double and char. Some details about these data types are as follows −int - This is used for integer data types which normally require 4 bytes of memory space.float - This is ... Read More

C++ "Hello, World!" Program

karthikeya Boyini

karthikeya Boyini

Updated on 23-Jun-2020 16:25:01

14K+ Views

C++ is a general purpose programming language that supports procedural, object-oriented and generic programming. C++ is a superset of C and all valid C programs are valid in C++ as well.C++ supports object oriented programming with features such as data hiding, encapsulation, inheritance, polymorphism etc.Let us see the first C++ ... Read More

Python program to find Largest, Smallest, Second Largest, and Second Smallest in a List?

karthikeya Boyini

karthikeya Boyini

Updated on 23-Jun-2020 16:11:30

1K+ Views

Array is given, we have to find out maximum, minimum, secondlargest, second smallest number.AlgorithmStep 1: input list element Step 2: we take a number and compare it with all other number present in the list. Step 3: get maximum, minimum, secondlargest, second smallest number.Example code# To find largest, smallest, second ... Read More

Python code to print common characters of two Strings in alphabetical order

karthikeya Boyini

karthikeya Boyini

Updated on 23-Jun-2020 16:09:56

833 Views

Two user input strings are given, our task is to print all the common characters in alphabetical order.ExampleInput: string1: python string2: program Output: opExplanationThe letters that are common between the two strings are o (1 times), p (1 time)AlgorithmStep 1: first we take two input string. Step 2: next we ... Read More

Advertisements