C Language

div ldiv lldiv function in C

div, ldiv, lldiv, functions in C

The div, ldiv, and lldiv, functions compute quotient (numer / denom ) and remainder (numer % denom ) in a single operation. These functions div, ldiv, and lldiv, are defined in stdlib.h header file and returns a structure that comprises the quotient and the remainder. So let see these function one by one with some […]

div, ldiv, lldiv, functions in C Read More »

abs labs llabs in c

abs labs llabs functions in C/C++

The abs, labs, llabs functions compute the absolute value of an integer. These functions abs, labs, llabs are defined in stdlib.h header file. The behavior of these functions is undefined if the result cannot be represented by the return type. So let see these function one by one with some example code. abs(): The abs

abs labs llabs functions in C/C++ Read More »

How to use and implement strpbrk in C

The strpbrk function scan the string s1 and finds the first character in the string s1 that matches any character specified in string s2. The search does not include the terminating null-characters of either string but ends there. Syntax strpbrk in C: //General Syntax of strpbrk char *strpbrk(const char *s1, const char *s2); Parameters: s1— The

How to use and implement strpbrk in C Read More »

Use of strrchr function in C/C++

The strrchr function finds the last occurrence of c (converted to a char) in the string pointed to by s. The terminating null character is also considered to be part of the string and it can be found if searching for ‘\0’.  The strrchr function defines in string.h header file and takes two arguments. Syntax

Use of strrchr function in C/C++ Read More »