Jump to content

Write a small program adding two positive numbers with out using + or -*-


Recommended Posts

Posted
6 minutes ago, Manikyam said:

a= 2
b = 3
x = sum([a, b])
print(x)

With out using functions also possible aa?

Eppudoo 14 years kinda chaduvukunna chaduvulu

Mistake iathe nannu oggeyi

  • dasari4kntr changed the title to Write a small program adding two positive numbers with out using + or -*-
Posted
44 minutes ago, Patient31Covid19 said:

use bit operators

Correct  ...but it will iterate more if input is huge numbers...

Is it something possible in single line?

Posted
49 minutes ago, dasari4kntr said:

Correct  ...but it will iterate more if input is huge numbers...

Is it something possible in single line?

def sumlist(x):
    ln = [int(i) for i in list(x.split(","))]
    return sum(ln)
    

x = "1,2,3,4,5"
s = sumlist(x)
print(s)

  • Upvote 2
Posted
1 hour ago, Hydrockers said:

With out using functions also possible aa?

Eppudoo 14 years kinda chaduvukunna chaduvulu

Mistake iathe nannu oggeyi

seyachu using bitwise

 

Posted

Yendi vuncle Satday lu Funday lu kuda ila ee coding lu. Poragallani kuda intla ila ne saavaodthurra yendi. 

  • Haha 1
Posted
5 hours ago, Sucker said:

Yendi vuncle Satday lu Funday lu kuda ila ee coding lu. Poragallani kuda intla ila ne saavaodthurra yendi. 

@cc

Posted
5 hours ago, dasari4kntr said:

This is one alternate way i can think....

a+b= (a2-b2)/(a-b)

FGMYZ1uOZWsX7lEOyk9dwcffbf4unEvopc_p-RgJ

ne title ki 

ne solution ki emaina sambandam unda

 

 

  • Haha 1
Posted
1 minute ago, Manikyam said:

ne title ki 

ne solution ki emaina sambandam unda

 

Write a small program adding two positive numbers with out using + or -*-

Emi miss aindhi bro...

Posted
1 minute ago, dasari4kntr said:

Emi miss aindhi bro...

okay + - * anukunna

+ or * aa  

  • Thanks 1
Posted
5 hours ago, dasari4kntr said:

This is one alternate way i can think....

a+b= (a2-b2)/(a-b)

FGMYZ1uOZWsX7lEOyk9dwcffbf4unEvopc_p-RgJ

This is wrong. It holds true only when a isn’t equal to b.
you’re limiting the value of the function.

  • Upvote 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...