# HackerRank C

## Querying the Document in C – Hacker Rank Solution

A document is represented as a collection paragraphs, a paragraph is represented as a collection of sentences, a sentence is represented as a collection of words and a word is represented as a collection of lower-case ([a-z]) and upper-case ([A-Z]) English characters. You will convert a raw text document into its component paragraphs, sentences and …

## Variadic functions in C – Hacker Rank Solution

Variadic functions are functions which take a variable number of arguments. In C programming, a variadic function will contribute to the flexibility of the program that you are developing. The declaration of a variadic function starts with the declaration of at least one named variable, and uses an ellipsis as the last parameter, e.g.  int …

## Bitwise Operators in C – Hacker Rank Solution

Objective This challenge will let you learn about bitwise operators in C.Inside the CPU, mathematical operations like addition, subtraction, multiplication and division are done in bit-level. To perform bit-level operations in C programming, bitwise operators are used which are explained below.  Bitwise AND operator & The output of bitwise AND is 1 if the corresponding …

## Permutations of Strings in C – Hacker Rank Solution

Strings are usually ordered in lexicographical order. That means they are ordered by comparing their leftmost different characters. For example abc < abd, because c < d. Also z > yyy because z > y. If one string is an exact prefix of the other it is lexicographically smaller, e.g., gh < ghij. Given an array of strings sorted in lexicographical …

## Sum of Digits of a Five Digit Number in C – Hacker Rank Solution

Objective In order to get the last digit of a number, we use modulo operator \%. When the number is modulo divided by 10 we get the last digit.To find first digit of a number we divide the given number by 10 until number is greater than 10. At the end we are left with …

## Sorting Array of Strings – Hacker Rank Solution

To sort a given array of strings into lexicographically increasing order or into an order in which the string with the lowest length appears first, a sorting function with a flag indicating the type of comparison strategy can be written. The disadvantage with doing so is having to rewrite the function for every new comparison …