Sudhir sharma has Published 1149 Articles

Write a function that returns 2 for input 1 and returns 1 for 2 in C programming

sudhir sharma

sudhir sharma

Updated on 09-Aug-2019 12:08:13

391 Views

A function that returns 2 for input 1 and 1 for input 2 is to be made. This function can be made in many ways based on the logic you use. The easiest way to do this is to use a conditional statement that if the number is 1 then ... Read More

Ways to paint N paintings such that adjacent paintings don’t have same colors in C programming

sudhir sharma

sudhir sharma

Updated on 09-Aug-2019 12:04:02

679 Views

In this problem, you are given N painting and we have m color that we can make paintings with and we need to find the number of ways in which we can draw the painting such that none of the same color paintings are to each other.The program’s output can ... Read More

Surface Area and Volume of Hexagonal Prism in C programming

sudhir sharma

sudhir sharma

Updated on 09-Aug-2019 12:01:50

481 Views

The surface area of any figure is the total area that it's surface cover.A hexagonal prism is a three-dimensional figure that has a hexagon at both its ends. exam on prism looks like -In mathematics, Hexagonal prism is defined as three dimensional figure with 8 faces, 18 edges, 12 vertices.Surface ... Read More

Sums of ASCII values of each word in a sentence in c programming

sudhir sharma

sudhir sharma

Updated on 09-Aug-2019 11:49:06

420 Views

The ASCII value of the ward is the integer presentation based on ASCII standards. In this problem, we are given a sentence and we have to calculate the sum of ASCII values of each word in the sentence.For this we will have to find the ASCII values of all the ... Read More

Sum triangle from an array in C programming

sudhir sharma

sudhir sharma

Updated on 09-Aug-2019 11:46:46

725 Views

The sum triangle from an array is a triangle that is made by decreasing the number of elements of the array one by one and the new array that is formed is with integers that are the sum of adjacent integers of the existing array. This procedure continues until only ... Read More

C Programming for sum of the series 0.6, 0.06, 0.006, 0.0006, …to n terms

sudhir sharma

sudhir sharma

Updated on 09-Aug-2019 11:41:53

253 Views

The given series 0.6, 0 .o6, .... is a geometric progression where each element is the previous element divided by 10. So find the sum of the series we have to apply the sum of GP one formula for r less than 1(r=0.1 in our case).Sum = 6/10 [1- (1/10)n/(1-1/10)] ... Read More

C Programming for Sum of sequence 2, 22, 222, ………

sudhir sharma

sudhir sharma

Updated on 09-Aug-2019 11:40:23

1K+ Views

Given is a sequence: 2, 22, 222, 2222….. and we need to find the sum of this sequence. So we have to Go for the mathematical formula that is made to find the sum of the series, The explanation of the formula goes in such a way that -sum =[2+22+222+2222….] ... Read More

Sum of the numbers up to N that are divisible by 2 or 5 in c programming

sudhir sharma

sudhir sharma

Updated on 09-Aug-2019 11:37:58

472 Views

Sum of n natural numbers that are divisible by 2 or 5 can be found by finding the sum of all natural numbers up to N that is divisible by 2 and sum of all natural numbers up to N that is divisible by 5. Adding these two sums and ... Read More

Sum of the nodes of a Singly Linked List in C Program

sudhir sharma

sudhir sharma

Updated on 09-Aug-2019 11:34:13

4K+ Views

A singly linked list is a data structure in which an element has two parts one is the value and other is the link to the next element. So to find the sum of all elements of the singly linked list, we have to navigate to each node of the ... Read More

Sum of the first N terms of the series 5,12, 23, 38…. in C Programming

sudhir sharma

sudhir sharma

Updated on 09-Aug-2019 11:30:37

156 Views

To find the sum of the given series, we will analyze the series and try to get some traits that show it is known series or at least is a combination of 2 - 3 series. the given series is 5, 12, 23, 38…We have to find the sum of ... Read More

Advertisements