{"id":17009,"date":"2021-08-17T08:50:04","date_gmt":"2021-08-17T03:20:04","guid":{"rendered":"https:\/\/python-programs.com\/?p=17009"},"modified":"2021-11-22T18:37:21","modified_gmt":"2021-11-22T13:07:21","slug":"python-program-to-add-two-numbers-without-using-the-plus-operator","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-add-two-numbers-without-using-the-plus-operator\/","title":{"rendered":"Python Program to Add Two Numbers Without Using the \u201c+\u201d Operator"},"content":{"rendered":"

In the previous article, we have discussed Python Program to Find out the Arc Length of an Angle<\/a>
\nIn order to add two numbers without using the ‘+’ operator, we should use a mathematical formula.<\/p>\n

Formula :<\/strong><\/p>\n

Let x, y are the given two numbers, then<\/p>\n

x+y<\/strong> = x^2-y^2 = (x+y)(x-y)\u00a0 if\u00a0<\/strong>\u00a0 (x!=y).<\/p>\n

x+y<\/strong> = 2*x\u00a0<\/strong> \u00a0 (\u00a0 if x=y )<\/p>\n

Given two numbers and the task is to add the given two numbers without using the ‘+’ operator.<\/p>\n

Examples:<\/strong><\/p>\n

Example 1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given First Number      =  65\r\nGiven Second Number = 45<\/pre>\n

Output:\u00a0<\/strong><\/p>\n

The sum of given two numbers = 110.0<\/pre>\n

Example 2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given First Number      =  220.5\r\nGiven Second Number =  100<\/pre>\n

Output:<\/strong><\/p>\n

The sum of given two numbers = 320.5<\/pre>\n

Program to Add Two Numbers Without Using the \u201c+\u201d Operator.<\/h2>\n

Below are the ways to add the given two numbers without using the ‘+’ operator.<\/p>\n