
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 1339 Articles for C

2K+ Views
A super-prime number is A number that occupies prime number position in the sequence of all prime numbers. also known as high order primes, These numbers occupy the position in the sequence of prime number which is equal to Prime number. some super prime numbers are 3, 5, 11, 1 7…For Example let us Find all super prime numbers less than 13 -Input 13Output3, 5, 11.Explanation − to find the super prime number less than 13 we will find all prime numbers that are less than 13. So, show all prime numbers less than 13 are 2, 3, 5, 7, 11, ... Read More

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 characters of the sentence and then add them up, this will give the sum of ASCII values of letters in this word. we have to do the same for all words and finally, we will add all the sums and give a final sum of ASCII values of each word ... Read More

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 one element remains in the array.Let's take an example to explain the content better, Array = [3, 5, 7, 8, 9]Output[106] [47, 59] [20, 27, 32] [8, 12, 15, 17] [3, 5, 7, 8, 9]ExplanationFor the first array : ( 3 + 5 = 8), ( 5 + 7 = ... Read More

255 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)] Sum = 6/9 [1- (1/10)n] Sum = 2/3[1- (1/10n)]Example#include #include int main() { int n = 6; float sum = 2*((1 - 1 / pow(10, n)))/3; printf("sum = %f", sum); }Outputsum = 0.666666

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….] sum= 2*[1+11+111+1111….] Sum = 2/9[9+99+999+9999….] sum= 2/9 [10+100+1000+10000+.....] sum = 2/9[10+102+103+104+.....] sum=2/9*[(10n-1-9n)/9]Example#include #include int main() { int n = 3; float sum = 2*(pow(10, n) - 1 - (9 * n))/81; printf("sum is %d", sum); return 0; }Outputsum is 879

473 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 then subtracting it by the sum of natural numbers up to N that is divisible by 10, this gives us the desired result. This method is an efficient method that can be used to find sum up to large values of n.Some of you must be thinking of using a ... Read More

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 linked list and add the element's value to a sum variable.For exampleSuppose we have a linked list: 2 -> 27 -> 32 -> 1 -> 5 sum = 2 + 27 + 32 + 1 + 5 = 67.This can be done by using two methods :Method 1 - Using a ... Read More

158 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 the series for any value of nFor exampleFor n = 3 Sum = 40.On analyzing the given series, you will find that this series is Quadratic series. In quadratic series, the difference of the numbers is in an arithmetic progression( increase by definite number)So we can directly use the formula ... Read More

205 Views
To find the sum of this series, we will first analyze this series.The series is:The given series is 2, 10, 30, 68…For exampleFor n = 6 Sum = 464On analysis of the given series, you will see that the series is the addition of two series first one is the series of n natural numbers and the second is the cube of n natural numbers this means the series can be split as:2, 10 , 30 ,68 = (1+13) , (2+23), (3 + 33), ( 4 + 43)so we can write the sum of the series as :sum = 2 ... Read More

338 Views
To find the sum of this series, we will first analyze this series.The series is: 2,6,12,20,30…ExampleFor n = 6 Sum = 112 On analysis, (1+1),(2+4),(3+9),(4+16)... (1+12), (2+22), (3+32), (4+42), can be divided into two series i.e. s1:1,2,3,4,5… andS2: 12,2,32,....Find the sum of first and second using mathematical formulaSum1 = 1+2+3+4… , sum1 = n*(n+1)/2 Sum2 = 12+22+32+42… , sum1 = n*(n+1)*(2*n +1)/6Example#include int main() { int n = 3; int sum = ((n*(n+1))/2)+((n*(n+1)*(2*n+1))/6); printf("the sum series till %d is %d", n,sum); return 0; }OutputThe sum of series till 3 is 20