Sunidhi Bansal has Published 1078 Articles

C++ Program Probability for three randomly chosen numbers to be in AP

Sunidhi Bansal

Sunidhi Bansal

Updated on 20-Nov-2019 12:24:58

225 Views

Given with an array of numbers ‘n’ and the task is to find the probability of three randomly chosen numbers to be in AP.ExampleInput-: arr[] = { 2, 3, 4, 7, 1, 2, 3 } Output-: Probability of three random numbers being in A.P is: 0.107692 Input-:arr[] = { 1, ... Read More

C Program for sum of cos(x) series

Sunidhi Bansal

Sunidhi Bansal

Updated on 20-Nov-2019 12:23:00

5K+ Views

We are given with the value of x and n where, x is the angle for cos and n is the number of terms in the cos(x) series.For Cos(x)Cos(x) is a trigonometric function which is used to calculate the value of x angle.Formula$$\cos (x) = \displaystyle\sum\limits_{k=0}^\infty \frac{(-1)^{k}}{(2k!)}x^{2k}$$For Cos(x) seriesCos(x) = ... Read More

C Program for nth Catalan Number

Sunidhi Bansal

Sunidhi Bansal

Updated on 20-Nov-2019 12:19:33

2K+ Views

Given an interger n; the task is to find the Catalan Number on that nth position. So, before doing the program we must know what is a Catalan Number?Catlan numbers are the sequence of natural numbers, which occurs in the form of various counting number problems.Catalan numbers C0, C1, C2, ... Read More

C++ Program for quotient and remainder of big number

Sunidhi Bansal

Sunidhi Bansal

Updated on 20-Nov-2019 12:15:19

450 Views

Given a sting of a big number say num and another big number say m; the task is to print the quotient using divide operation and the remainder of the big number using modulus.The output should be Remainder = xxx; Quotient = yyyLet’s assume we have an input num = ... Read More

C Program that receives a number and prints it out in large size

Sunidhi Bansal

Sunidhi Bansal

Updated on 20-Nov-2019 11:53:00

442 Views

Given a number n in form of a string; the task is to print that following number in large using hash symbols.Like we have provided a number “1234”The representation of the following number should be −Likewise we want our solution to be printed −ExampleInput: n[] = {“2234”} Output:Input: n[] = ... Read More

C Program to check if a number belongs to a particular base or not

Sunidhi Bansal

Sunidhi Bansal

Updated on 20-Nov-2019 11:27:45

1K+ Views

Given a number as a string and a base; the task is to check whether the given number of is of that given base or not.We have to check the number and the base according to the number system in which there are bases like 2 for a binary number, ... Read More

C Program for N-th term of Arithmetic Progression series

Sunidhi Bansal

Sunidhi Bansal

Updated on 20-Nov-2019 11:10:57

9K+ Views

Given ‘a’ the First term, ‘d’ the common difference and ‘n’ for the number of terms in a series. The task is to find the nth term of the series.So, before discussing how to write a program for the problem first we should know what is Arithmetic Progression.Arithmetic progression or ... Read More

C Program for N-th term of Geometric Progression series

Sunidhi Bansal

Sunidhi Bansal

Updated on 20-Nov-2019 11:06:09

5K+ Views

Given ‘a’ the First term, ‘r’ the common ratio and ‘n’ for the number of terms in a series. The task is to find the nth term of the series.So, before discussing how to write a program for the problem first we should know what is Geometric Progression.Geometric progression or ... Read More

C Program to calculate the Round Trip Time (RTT)

Sunidhi Bansal

Sunidhi Bansal

Updated on 20-Nov-2019 10:59:01

1K+ Views

Given an Url address of any website; the task is to calculate the round trip time of a website.Round Trip Time(RTT) is the total time or the length of a time which is taken to send a signal plus the time taken to receive the acknowledgement of that signal to ... Read More

C Program to Change RGB color model to HSV color model

Sunidhi Bansal

Sunidhi Bansal

Updated on 20-Nov-2019 10:52:39

3K+ Views

Given RGB color range in form of integers; the task is to find its appropriate HSV color by converting the RGB color rangeWhat is RGB color modelRGB color model comprised of three colors Red, Green and Blue. RGB model is a color model which is widely used in the display ... Read More

Advertisements