Smita Kapse has Published 558 Articles

isnormal() in C++

Smita Kapse

Smita Kapse

Updated on 30-Jul-2019 22:30:26

80 Views

In this section we will see the isnormal() function in C++. This function is present in the cmath library. This function is used to check whether a number is normal or not. The numbers that are considered as non-normal are zeros, infinity or NAN.This function takes float, double or long ... Read More

ctime() Function in C/C++

Smita Kapse

Smita Kapse

Updated on 30-Jul-2019 22:30:26

330 Views

The C library function char *ctime(const time_t *timer) returns a string representing the localtime based on the argument timer.The returned string has the following 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, ... Read More

C++ Program to Find All Forward Edges in a Graph

Smita Kapse

Smita Kapse

Updated on 30-Jul-2019 22:30:26

205 Views

In this section, we shall consider a C++ program to find all forward edges in a graph.AlgorithmsFor topo functionBegin    Declare function topo()       Declare pointer v, m[][5] and i of the integer datatype.       x = new Node_Inf.       x->n = i.   ... Read More

8086 program to determine subtraction of corresponding elements of two arrays

Smita Kapse

Smita Kapse

Updated on 30-Jul-2019 22:30:26

233 Views

In this program we will see how to subtract the contents of two different arrays.Problem StatementWrite 8086 Assembly language program to subtract the contents to corresponding elements which are stored in two different arraysDiscussionIn this example there are two different arrays. The arrays are stored at location 501 onwards and ... Read More

“Toggle” query in MongoDB?

Smita Kapse

Smita Kapse

Updated on 30-Jul-2019 22:30:26

318 Views

You need to find the document and after that you need to use update to toggle query. Let us first create a collection with documents −> db.toggleDemo.insertOne({"CustomerName":"John Smith", "CustomerAge":28, "isMarried":true}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cc7be138f9e6ff3eb0ce43b") } > db.toggleDemo.insertOne({"CustomerName":"David Miller", "CustomerAge":25, "isMarried":false}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cc7be2e8f9e6ff3eb0ce43c") }Following is the query to display ... Read More

How to remove white spaces (leading and trailing) from string value in MongoDB?

Smita Kapse

Smita Kapse

Updated on 30-Jul-2019 22:30:26

429 Views

For this, you need to write some code using forEach(). Let us first create a collection with documents −> db.removingWhiteSpaceDemo.insertOne({"Title":" Introduction to java "}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cd66f387924bb85b3f4894c") }Following is the query to display all documents from a collection with the help of find() method ... Read More

C++ Program to Check if a Given Set of Three Points Lie on a Single Line or Not

Smita Kapse

Smita Kapse

Updated on 30-Jul-2019 22:30:26

614 Views

This is a C++ program to check if a given set of three points lie on a single line or not. Three points lie on a single line if the area of the triangle formed by this points is equal to zero.The area of the triangle is −0.5 * (x1 ... Read More

Pull multiple objects from an array in MongoDB?

Smita Kapse

Smita Kapse

Updated on 30-Jul-2019 22:30:26

876 Views

To pull multiple objects from an array, you can use $pull operator. Let us first create a collection with documents −> db.pullMultipleObjectsDemo.insertOne( ...    { ...       "ClientId" : "100", ...       "ClientName" : "John", ...       "ClientPersonalDetails" : [ ...       ... Read More

MongoDB query check if value in array property?

Smita Kapse

Smita Kapse

Updated on 30-Jul-2019 22:30:26

2K+ Views

You can use $in operator to check if a value is in an array or not. Let us first create a collection with documents −> db.valueInArrayDemo.insertOne({"UserName":"John", "UserMessage":["Hi", "Hello", "Bye"]}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cd684cf7924bb85b3f48959") } > db.valueInArrayDemo.insertOne({"UserName":"Larry", "UserMessage":["Thank You", "Amazing", "Nice"]}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cd684d27924bb85b3f4895a") } >db.valueInArrayDemo.insertOne({"UserName":"Carol", "UserMessage":["Awesome", "Bye", "Cool"]}); { ... Read More

Bind function and placeholders in C++

Smita Kapse

Smita Kapse

Updated on 30-Jul-2019 22:30:26

2K+ Views

Here we will see the Bind function and the placeholders in C++. Sometimes we need to manipulate the operation of some functions as we need. We can use some default parameters to get some essence of manipulating.In C++11, one new feature is introduced, called the bind function. This helps us ... Read More

Advertisements