Sunidhi Bansal has Published 1078 Articles

Program to compute Log n in C

Sunidhi Bansal

Sunidhi Bansal

Updated on 18-Oct-2019 13:05:04

559 Views

Given with the value of n as an input and the task is to compute the value of Log n through a function and display it.Logarithm or Log is the inverse function to exponentiation which means to calculate log the raised power must be calculated as a base.IF  $$\log_b x\;\:=\: ... Read More

Products of ranges in an array in C

Sunidhi Bansal

Sunidhi Bansal

Updated on 18-Oct-2019 12:57:04

635 Views

Given with array, L, R, P as an input and the task is to find the ranges between L and R with the product under modulo as output and display itAs given in the figure we have array of elements and L which is a Left value as 2 and ... Read More

C Program for diamond pattern with different layers

Sunidhi Bansal

Sunidhi Bansal

Updated on 18-Oct-2019 12:40:05

328 Views

Given with the number and the task is to generate the diamond pattern with the given n different layers and display it.ExampleInput: n = 3Output:Approach used in the below program is as follows −Input the number of rowsAnd in this pattern there are ((2 * n) + 1) rowsNumber of ... Read More

C Program to add two fractions

Sunidhi Bansal

Sunidhi Bansal

Updated on 18-Oct-2019 12:26:44

3K+ Views

Given with the input as fraction i.e. a/b and c/d where a, b, c and d can be any integer values other than 0 and the task is to add these two fraction to generate their final sum.Fractions are represented by −a / b, where a is known as numerator ... Read More

C++ Program for sum of arithmetic series

Sunidhi Bansal

Sunidhi Bansal

Updated on 18-Oct-2019 12:18:02

4K+ Views

Given with ‘a’(first term), ‘d’(common difference) and ‘n’ (number of values in a string) and the task is to generate the series and thereby calculating their sum.What is an Arithmetic seriesArithmetic series is the sequence of numbers with common difference where the first term of a series is fixed which ... Read More

C++ Program to check if tank will overflow, underflow or filled in given time

Sunidhi Bansal

Sunidhi Bansal

Updated on 18-Oct-2019 12:07:06

309 Views

Given with the rate of filling the tank, height of a tank and radius of a tank and the task is to check whether the tank is overflow, underflow and filled in given time.ExampleInput-: radius = 2, height = 5, rate = 10 Output-: tank overflow Input-: radius = 5, ... Read More

C++ program to check if first and the last characters of string are equal

Sunidhi Bansal

Sunidhi Bansal

Updated on 18-Oct-2019 11:27:44

1K+ Views

Given with an input of string and the task is to check whether the first and last characters of given string is equal or not.ExampleInput-: study Output-: not equal    As the starting character is ‘s’ and the end character of a string is ‘y’ Input-: nitin Output-: yes it ... Read More

C++ program to Calculate the Edge Cover of a Graph

Sunidhi Bansal

Sunidhi Bansal

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

283 Views

Given a n number of vertices of a graph, the task is to calculate the edge cover of the graph. Edge cover is to find the minimum number of edges required to cover every vertex of the graph.Like we have n = 5Then its graph will be like −So its ... Read More

C++ program to calculate Profit Or Loss

Sunidhi Bansal

Sunidhi Bansal

Updated on 18-Oct-2019 11:18:06

4K+ Views

Given with the cost price(CP) and the selling price(SP) and the task is to calculate the profit gained or loss incurred.Cost price or CP is the price at which the product is purchased by the seller and the selling price or SP is the price at which the product is ... Read More

C++ program to calculate GST from original and net prices

Sunidhi Bansal

Sunidhi Bansal

Updated on 18-Oct-2019 11:13:59

2K+ Views

Given with the original cost and net price as an input and the task is to calculate the GST percentage and display the resultGST stands for Goods and Service task. It is always included in the Net price of the product and before calculating the GST percentage we need to ... Read More

Advertisements