Sunidhi Bansal has Published 1078 Articles

C program to calculate distance between two points

Sunidhi Bansal

Sunidhi Bansal

Updated on 18-Oct-2019 11:10:35

3K+ Views

Given with the two points coordinates and the task is to find the distance between two points and display the result.In a two dimension plane there are two points let’s say A and B with the respective coordinates as (x1, y1) and (x2, y2) and to calculate the distance between ... Read More

C program to calculate distance between three points in 3D

Sunidhi Bansal

Sunidhi Bansal

Updated on 18-Oct-2019 11:02:39

1K+ Views

Given with the 3-D plane and hence three coordinates and the task is to find the distance between the given points and display the result.In a three dimension plane there are three axis that are x-axis with its coordinates as (x1, y1, z1), y-axis with its coordinates as (x2, y2, ... Read More

C program to calculate age

Sunidhi Bansal

Sunidhi Bansal

Updated on 18-Oct-2019 10:57:19

29K+ Views

Given with the current date and the birth date of a person and the task is to calculate his current age.ExampleInput-: present date-: 21/9/2019    Birth date-: 25/9/1996 Output-: Present Age    Years: 22 Months:11 Days: 26Approach used below is as follows −Input the current date and birth date of ... Read More

C program to Calculate Body Mass Index (BMI)

Sunidhi Bansal

Sunidhi Bansal

Updated on 18-Oct-2019 09:15:50

11K+ Views

Given with the weight and height of a person and the task is to find the BMI i.e. body mass index of his body and display it.For calculating the body mass index we require two things −WeightHeightBMI can be calculated using the formula given below −BMI = (mass or weight) ... Read More

C++ program to check for ISBN

Sunidhi Bansal

Sunidhi Bansal

Updated on 18-Oct-2019 09:10:26

1K+ Views

Given with the sequence and the task is to identify whether the given sequence is sa ISBN number or not.What is an ISBN numberISBN stands for International Standard Book Number is a 10 digit number till December 2006 and now it is revised to 13 digit number from 1 January ... Read More

C++ program for multiplication of array elements

Sunidhi Bansal

Sunidhi Bansal

Updated on 18-Oct-2019 09:03:59

7K+ Views

Given with an array of integer elements and the task is to multiply the elements of an array and display it.ExampleInput-: arr[]={1, 2, 3, 4, 5, 6, 7} Output-: 1 x 2 x 3 x 4 x 5 x 6 x 7 = 5040 Input-: arr[]={3, 4, 6, 2, 7, ... Read More

C++ program for length of the longest word in a sentence

Sunidhi Bansal

Sunidhi Bansal

Updated on 18-Oct-2019 09:01:01

1K+ Views

Given with the sentence of multiple strings and the task is to find the length of the longest string in the sentence.ExampleInput-: hello I am here Output-: maximum length of a word is: 5 Input-: tutorials point is the best learning platform Output-: maximum length of a word is: 9Approach ... Read More

C++ program for length of a string using recursion

Sunidhi Bansal

Sunidhi Bansal

Updated on 18-Oct-2019 08:50:22

735 Views

Given with the string and the task is to calculate the length of the given string using a user defined function or in-built function.Length of a string can be calculated using two different ways −Using user defined function − In this, traverse the entire string until ‘\o’ is found and ... Read More

C++ program for hexadecimal to decimal

Sunidhi Bansal

Sunidhi Bansal

Updated on 18-Oct-2019 08:46:11

4K+ Views

Given with a hexadecimal number as an input, the task is to convert the given hexadecimal number into a decimal number.Hexadecimal number in computers is represented with base 16 and decimal number is represented with base 10 and represented with values 0 - 9 whereas hexadecimal number have digits starting ... Read More

C++ Program to calculate Bitonicity of an Array

Sunidhi Bansal

Sunidhi Bansal

Updated on 18-Oct-2019 08:40:46

191 Views

Given with an array of integers and the task is to calculate the bitonicity of a given array using a function.Bitonicity of an array is −Initialised to 0Incremented to 1 when the next element is greater than the previous valueDecremented to 1 when the next element is lesser than the ... Read More

Advertisements