Set in C++ is an associative container and contains unique elements. All the elements once added to a specific cannot be modified. One can only remove and add elements in order to change them.Pair is defined under header and is used to couple together two pair values. The pair can have values of different or same type. The class has member functions first() and second() to individually access the values in a pair.The order of pair elements is fixed (first, second). We can use pair to combine two heterogeneous values of different types.To access any element we use variable_name.first ... Read More
The function operator= is used in sets to copy one set (or move to another in C++ STL. It behaves as a normal ‘=’ assignment operation for sets. There are there overloaded forms of this function −copy :- set& operator= (const set& s1) −This function copies all the elements in set s1 to another set. The parameter passed is set of the same type.Usage − set s1=s2;move :- set& operator=( set &&s1 ) −This moves the elements of set s1 into the calling set.Initializer list :- set& operator= (initializer_list ilist) −This version copies the values of the initializer list ilist ... Read More
The round() function in C++ is used to round off the double, float or long double value passed to it as a parameter to the nearest integral value. The header file used to use the round() function in a c++ program is or .Following are the overloaded versions of round() after C++ 11 standarddouble round( double D )float round( float F )long double round( long double LD )double round ( T var )Note − The value returned is the nearest integer represented as floating point, i.e for 2.3 nearest value returned will be 2.0 and not 2.Following program is ... Read More
Rotation of a point X about origin is by an angle θ in anti-clockwise direction is done by − X by θ about origin anti-clRotateockwise: X*polar( 1.0, θ ).Here, the function polar for complex numbers is defined under header file and is used to find a complex number using phase angle and magnitude. polar(mag, angle) returns a complex number.Rotation of point X about a point YTo rotate a point about another point, we will use translation in which movement of all coordinates occur in a particular direction.Steps to rotate X about Y.Translate X to Y, so Y becomes the new ... Read More
The abnormal behavior of C++ programs often leads to program crash. You may have encountered problems like Segmentation fault, Aborted, Floating point exception etc. Following are sample programs that may help you to understand the reasons for a C++ program crash.ExceptionsExceptions in C++ are responses of a program when it encounters an abnormal condition. The program crashes due to such exceptions if they are not handled properly using try-catch blocks. Following program crashes due to divide by zero exception −Example#include int main(){ int num1=10; int num2=0; int quotient=num1/num2; printf(" Quotient is: %d", quotient); return ... Read More
To test the remote connectivity using PowerShell Test-Connection command is used. PowerShell also supports the Ping command and both the commands are almost produce the same output but Test- Connection cmdlet supports advanced parameters. See how both commands output look.Ping Command −PS C:\Temp> ping Test1-Win2k16 Pinging Test1-Win2k16 [192.168.0.108] with 32 bytes of data: Reply from 192.168.0.108: bytes=32 time Test-Connection Test1-win2k16 Source Destination IPV4Address IPV6Address ------ ----------- ----------- ----------- ADDC Test1-win2k16 192.168.0.108 ADDC Test1-win2k16 192.168.0.108 ADDC Test1-win2k16 192.168.0.108 ADDC Test1-win2k16 192.168.0.108You can reduce the number of checks using ... Read More
Internet Explorer (IE) supports the enhanced protection mode for more security of the browser and the same can be enabled/disabled using PowerShell. Let see when we can find this setting in IE.Internet Explorer → Internet Options → Advanced → Enable Enhanced Protection ModeWe can modify this setting using PowerShell and for that registry settings need to be done. Registry value can be found under Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main and the key name is Isolation for enhanced protection mode.PMIL – To disable IE enhanced protection ModePMEM – To Enable IE enhanced protection modeTo make the changes using the script.Enable IE EP modeIf there ... Read More
The major differences between contribution margin and gross margin are as follows −Contribution MarginIt is used by pricing decision (whether product line is making profits or not).Contribution margin = difference between sales and variable costs divides by sales.It analyses profit metric per item.Only variable cost is considered for calculations.It determines the margin for production, where only variable costs are present.It detects variable costs and its percentage included in margin.It is useful for multiple scenario analysis.Gross MarginWhether production cost is covered by its sales or not.Gross margin = difference between revenue and Cost of goods sale/revenue.It analyses total profit metric.It considers ... Read More
The major differences between share outstanding and float are as follows −Share OutstandingThese are shares held by stakeholders, company officials and investors in public domain.Contains both stock float and restricted shares.Contains all shares of company held by its investors.It is used to calculate market capitalisation and earnings per share (EPS).It provides voting right and ownership right.Private or public limited company will issue these kinds.It has low risk.FloatIt is share issued by company to public and available to investors for trading in stock market.Contains only float stock.It is available for public.It acts as determinant of financial calculations.Won’t provide voting right and ... Read More
The major differences between discount rate and interest rate are as follows −Discount RateFederal reserve banks charges to depository institution/commercial banks on its overnight loans.Central banks decide the rate.It is not determined by market rate of interest.It determines present value of future cash flows.It focuses on investors view.The demand and supply has no effect on discount rate.Interest RateIt is an amount charged by lender to a borrower for use of assets.Commercial banks decide the rate.It depends on market rate of interest, creditworthiness etc.It can’t determine present value.It focuses on lender’s view.The demand and supply has effect on interest rate.Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP