How to perform logical andNot operation on BitSet in Java ?

Declaration : [crayon-5954c1baa6765808440742/] Explanation : Purpose The andNot(BitSet set) method clears all of the bits in this BitSet whose corresponding bit is set in the specified BitSet. Parameters set ===> the BitSet with which to mask this BitSet. Return Value This method does not return a value. Exception NA Java Program : Example Below example will explain java.util.BitSet.andNot() method. [crayon-5954c1baa676f775882106/] Output of Program : [crayon-5954c1baa6774370989001/]

How to perform logical AND operation on BitSet in Java ?

Declaration : [crayon-5954c1baa6f47535228146/] Explanation : Purpose The and(BitSet set) method performs a logical AND of this target bit set with the argument bit set. This bit set is modified so that each bit in it has the value true if and only if it both initially had the value true and the corresponding bit in the bit set argument also had the value true. Parameters set ===> a bit set Return Value This method does not return a value. Exception NA Java Program : Example Below example will explain [...]

Atoi() – C library function Program

Declaration : [crayon-5954c1baa7315700459094/] Explanation : Purpose The C library function int atoi(const char *str) converts the string argument str to an integer (type int). Parameters str ===> This is the string representation of an integral number. Return Value This function returns the converted integral number as an int value. If no valid conversion could be performed it returns zero. Exception C Program : Example The following example shows the usage of atoi() function. [crayon-5954c1baa731c773403356/] Output : [crayon-5954c1baa7322987914260/]

Atof() – C library function Program

Declaration : [crayon-5954c1baa76f5990016619/] Explanation : Purpose The C library function double atof(const char *str) converts the string argument str to a floating-point number (type double). Parameters str ===> This is the string having the representation of a floating-point number. Return Value This function returns the converted floating point number as a double value. If no valid conversion could be performed it returns zero (0.0). Exception C Program : Example The following example shows the usage of atof() function. [crayon-5954c1baa76fc780113716/]

Atexit() – C library function Program

Declaration : [crayon-5954c1baa7aa5944799979/] Explanation : Purpose The C library function int atexit(void (*func)(void)) causes the specified function func to be called when the program terminates. You can register your termination function anywhere you like but it will be called at the time of program termination. Parameters func ===> This is the function to be called at the termination of the program. Return Value This function returns a zero value if the function is registered successfully otherwise a non-zero value if it is failed. Exception C Program : Example The [...]

Atan2() – C library function Program

Declaration : [crayon-5954c1baa7d4f568214186/] Explanation : Purpose The C library function double atan2(doubly y double x) returns the arc tangent in radians of y/x based on the signs of both values to determine the correct quadrant. Parameters x ===> This is the floating point value representing an x-coordinate.y ===> This is the floating point value representing an y-coordinate. Return Value This function returns the principal arc tangent of y/x in the interval [-pi+pi] radians. Exception C Program : Example The following example shows the usage of atan2() function. [crayon-5954c1baa7d56314744169/]

Atan() – C library function Program

Declaration : [crayon-5954c1baa8005481923472/] Explanation : Purpose The C library function double atan(double x) returns the arc tangent of x in radians. Parameters x ===> This is the floating point value. Return Value This function returns the principal arc tangent of x in the interval [-pi/2+pi/2] radians. Exception C Program : Example The following example shows the usage of atan() function. [crayon-5954c1baa800d711229593/]

Asin() – C library function Program

Declaration : [crayon-5954c1baa82a9450371069/] Explanation : Purpose The C library function double asin(double x) returns the arc sine of x in radians. Parameters x ===> This is the floating point value in the interval [-1+1]. Return Value This function returns the arc sine of x in the interval [-pi/2+pi/2] radians. Exception C Program : Example The following example shows the usage of asin() function. [crayon-5954c1baa82b1376443139/]

Asctime() – C library function Program

Declaration : [crayon-5954c1baa8547186018174/] Explanation : Purpose The C library function char *asctime(const struct tm *timeptr) returns a pointer to a string which represents the day and time of the structure struct timeptr. Parameters Return Value This function returns a C string containing the date and time information in a human-readable format Www Mmm dd hh:mm:ss yyyy Where Www is the weekday Mmm the month in letters dd the day of the month hh:mm:ss the time and yyyy the year. Exception C Program : Example The following example shows [...]

Acos() – C library function Program

Declaration : [crayon-5954c1baa87eb139675046/] Explanation : Purpose The C library function double acos(double x) returns the arc cosine of x in radians. Parameters x ===> This is the floating point value in the interval [-1+1]. Return Value This function returns principal arc cosine of x in the interval [0 pi] radians. Exception C Program : Example The following example shows the usage of acos() function. [crayon-5954c1baa87f2275580735/]

Abs() – C library function Program

Declaration : [crayon-5954c1baa8a8e605536207/] Explanation : Purpose The C library function int abs(int x) returns the absolute value of int x. Parameters x ===> This is the integral value. Return Value This function returns the absolute value of x. Header File math.h Exception C Program : Example The following example shows the usage of abs() function. [crayon-5954c1baa8a96740893546/]

Abort() – C library function Program

Declaration : [crayon-5954c1baa8dc1887951689/] Explanation : Purpose The C library function void abort(void) abort the program execution and comes out directly from the place of the call. Parameters NA Return Value This function does not return any value. Header Filestdlib.hException C Program : Example The following example shows the usage of abort() function. [crayon-5954c1baa8dc9964789313/] In this case we don't have invisible.txt file present in the directory so when we compile the above program then output of the program will be like this - [crayon-5954c1baa8dce784992077/]

Atol() – C Library function Program

Declaration : [crayon-5954c1baa90eb989502938/] Explanation : Purpose The C library function long int atol(const char *str) converts the string argument str to a long integer (type long int). Parameters str ===> This is the string containing the representation of an integral number. Return Value This function returns the converted integral number as a long int. If no valid conversion could be performed it returns zero. Header File ctype.h Exception C Program : Example See below example of atol() function. [crayon-5954c1baa90f3461183733/] Output : [crayon-5954c1baa90f6782777858/]

How to check if ArrayDeque contains element in Java ?

Declaration : [crayon-5954c1baa9471692679071/] Explanation : Purpose The java.util.ArrayDeque.contains(Object) returns true if this deque contains the specified element. Parameters o ===> The object to be checked as contained in deque. Return Value This method returns true if this deque contains the specified element else false. Exception NA Java Program : Example Below example will explain java.util.ArrayDeque.contains() method. [crayon-5954c1baa9478804613489/] Output of Program : [crayon-5954c1baa947c359293159/]

How to get copy of ArrayDeque in Java ?

Declaration : [crayon-5954c1baa9773861499667/] Explanation : Purpose The java.util.ArrayDeque.clone() method returns a copy of this deque. Parameters NA Return Value This method returns a copy of this deque. Exception NA Java Program : Example Below example will explain java.util.ArrayDeque.getFirst() method. [crayon-5954c1baa977a616332326/] Output of Program : [crayon-5954c1baa977e589025026/]

How to remove All elements in ArrayDeque in Java ?

Declaration : [crayon-5954c1baa9a62465988289/] Explanation : Purpose The java.util.ArrayDeque.clear() method removes all of the elements from this deque. Parameters NA Return Value This method does not return any value. Exception NA Java Program : Example Below example will explain java.util.ArrayDeque.clear() method. [crayon-5954c1baa9a69463232437/] Output of Program : [crayon-5954c1baa9a6d567683113/]

How to insert element at end of ArrayDeque in Java ?

Declaration : [crayon-5954c1baa9d54491320243/] Explanation : Purpose The java.util.ArrayDeque.addLast(E e) method inserts the specified element E at the end of the deque. Parameters e ===> The element to be added at the end. Return Value This method does not return any value. Exception NullPointerException -- if the specified element is null. Java Program : Example Below example will explain java.util.ArrayDeque.addLast(E) method. [crayon-5954c1baa9d5b505461639/] Output of Program : [crayon-5954c1baa9d5f226992354/]

How to insert element at start of ArrayDeque in Java ?

Declaration : [crayon-5954c1baaa05b217870443/] Explanation : Purpose The java.util.ArrayDeque.addFirst(E e) method inserts the specified element E at the front of the deque. Parameters e ===> The element to be added in the deque. Return Value This method does not return any value. Exception NullPointerException -- if the specified element is null. Java Program : Example Below example will explain java.util.ArrayDeque.addFirst(E) method. [crayon-5954c1baaa062046742772/] Output of Program : [crayon-5954c1baaa066682225663/]

How to add element to ArrayDeque in Java ?

Declaration : [crayon-5954c1baaa359200880760/] Explanation : Purpose The java.util.ArrayDeque.add(E e) method inserts the specified element E at the end of the deque. This method is equivalent to addLast(E). Parameters e ===> The element to be added in the deque. Return Value This method returns true if given element is added successully into the deque otherwise it returns false. Exception NullPointerException -- if the specified element is null. Java Program : Example Below example will explain java.util.ArrayDeque.add(E) method. [crayon-5954c1baaa360414062129/] Output of Program : [crayon-5954c1baaa365953731437/]

How to return elements of ArrayDeque as array in Java ?

Declaration : [crayon-5954c1baaa65f341297436/] Explanation : Purpose The java.util.ArrayDeque.toArray() method returns an array containing all of the elements in this deque in proper sequence. Parameters NA Return Value This method returns an array containing all of the elements in this deque. Exception NA Java Program : Example Below example will explain java.util.ArrayDeque.toArray() method. [crayon-5954c1baaa666042529982/] Output of Program : [crayon-5954c1baaa66a724023414/]

How to calculate size of ArrayDeque in Java ?

Declaration : [crayon-5954c1baaa989809587440/] Explanation : Purpose The java.util.ArrayDeque.size() method returns the number of elements in this deque. Parameters NA Return Value This method returns the number of elements in this deque. Exception NA Java Program : Example Below example will explain java.util.ArrayDeque.size() method. [crayon-5954c1baaa991142168435/] Output of Program : [crayon-5954c1baaa994508353621/]

How to remove last element of ArrayDeque in Java ?

Declaration : [crayon-5954c1baaac72475401317/] Explanation : Purpose The java.util.ArrayDeque.removeLast() method retrieves and removes the last element of this deque. Parameters NA Return Value This method returns the tail (last element) of this deque. Exception NoSuchElementException -- if this deque is empty. Java Program : Example Below example will explain java.util.ArrayDeque.removeLast() method. [crayon-5954c1baaac79987966567/] Output of Program : [crayon-5954c1baaac7d824948555/]

How to remove first occurrence of element of ArrayDeque in Java ?

Declaration : [crayon-5954c1baaaf65773622313/] Explanation : Purpose The java.util.ArrayDeque.removeFirstOccurrence(Object) method removes the first occurrence of the specified element in this deque. Parameters o ===> The element whose first occurrence is to be removed from this deque if present. Return Value This method returns true if the deque contains the specified element. Exception NA Java Program : Example Below example will explain java.util.ArrayDeque.removeFirstOccurrence(o) method. [crayon-5954c1baaaf6c352537140/] Output of Program : [crayon-5954c1baaaf70721882190/]

How to remove first element of ArrayDeque in Java ?

Declaration : [crayon-5954c1baab24e378686128/] Explanation : Purpose The java.util.ArrayDeque.removeFirst() method retrieves and removes the first element of this deque. Parameters NA Return Value This method returns the head (first element) of this deque. Exception NoSuchElementException -- if this deque is empty. Java Program : Example Below example will explain java.util.ArrayDeque.removeFirst() method. [crayon-5954c1baab255894919565/] Output of Program : [crayon-5954c1baab259632348117/]

How to remove element of ArrayDeque in Java ?

Declaration : [crayon-5954c1baab531121449129/] Explanation : Purpose The java.util.ArrayDeque.remove() method retrieves and removes the head of the queue represented by this deque. Parameters NA Return Value This method returns the head of the queue represented by this deque. Exception NoSuchElementException -- if this deque is empty. Java Program : Example Below example will explain java.util.ArrayDeque.remove() method. [crayon-5954c1baab538321135370/] Output of Program : [crayon-5954c1baab53c705197724/]