@sharmila u r using + operator
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more
if this is the case
program can be rewritten to
#Iincludestdio.h
#includeconio.h
void main()
{
int a,b,i;
clrscr();
printf(enter 2 num:);
scanf(%d%d,a,b);
while(b--)
a++;
printf(%d,a);
getch();
}
Thank you,
Sid.
On Fri, Sep 2, 2011 at 11:30 AM, annarao kataru kataruanna...@gmail.comwrote:
Discussed Several time , Search Threads
here is one of the link
https://groups.google.com/forum/#!searchin/algogeeks/add$20two$20number$20/algogeeks/laWTN1xiwx0/lYoidUsr7mIJ
Thanks
Shashank Mani
Computer Science
Birla Institute of Technology Mesra
--
You received this message because you
Adding Two no without using any operator
#Iincludestdio.h
#includeconio.h
void main()
{
int a,b,i;
clrscr();
printf(enter 2 num:);
scanf(%d%d,a,b);
for(i=1;i=b-1;i++)
{
a=a+1;
}
printf(%d,a);
getch();
}
--
You received this message because you are subscribed to the Google Groups
Algorithm
@dave well that was basically a query if it is possible to eliminate all the
operators and do something like addition operation.I am sorry if I
presentted my question in the wrong wayI am bad at explaining things.:(
Going by your previous records I am not elibigle to contradict you.
On
Awesome Saurabh.
Hats off man:)
On Mon, Aug 29, 2011 at 2:43 PM, saurabh singh saurab...@gmail.com wrote:
@dave well that was basically a query if it is possible to eliminate all
the operators and do something like addition operation.I am sorry if I
presentted my question in the wrong
super
Thank you,
Sid.
On Sun, Aug 28, 2011 at 7:42 AM, saurabh singh saurab...@gmail.com wrote:
main()
{
int a=4,b=6;
printf(\n%d\n,printf(%*s%*s,a,,b,));
}
--
Saurabh Singh
B.Tech (Computer Science)
MNNIT ALLAHABAD
--
You received this message because you are subscribed to
can you please tell me how is this working
main()
{
int a=4,b=6;
printf(\n%d\n,printf(%*s%*s,a,,b,));
}
--
Saurabh Singh
B.Tech (Computer Science)
MNNIT ALLAHABAD
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to
@saurubh singhhow it is working ? plz explain the logic
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
printf returns the number of chars it puts on the stream
%*s the * is replaced by %value of as that is shifted a times and
similarly for b shifted by b times.The null string ensures that nothing
unwanted is printed
On Sun, Aug 28, 2011 at 7:22 PM, annarao kataru kataruanna...@gmail.comwrote:
@sourabh ; thank u very much
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more
if we give a=10, b=5 we get a^b=15
but wen a=10,b=7 we get a^b=13
why s it so,..???
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
@Shravanthi: Write a and b in binary, and then apply the bitwise
exclusive-or to them and you will see why.
Dave
On Aug 28, 9:24 am, Shravanthi U M shravanthium...@gmail.com wrote:
if we give a=10, b=5 we get a^b=15
but wen a=10,b=7 we get a^b=13
why s it so,..???
--
You received this
Very nice solution sourabh.
On Sun, Aug 28, 2011 at 9:52 PM, Dave dave_and_da...@juno.com wrote:
@Shravanthi: Write a and b in binary, and then apply the bitwise
exclusive-or to them and you will see why.
Dave
On Aug 28, 9:24 am, Shravanthi U M shravanthium...@gmail.com wrote:
if we give
But it works only for +ve numbers.
Sanju
:)
On Sun, Aug 28, 2011 at 9:57 AM, Abhishek Yadav
algowithabhis...@gmail.comwrote:
Very nice solution sourabh.
On Sun, Aug 28, 2011 at 9:52 PM, Dave dave_and_da...@juno.com wrote:
@Shravanthi: Write a and b in binary, and then apply the bitwise
@dave even '=' is an operator.I wonder if its possible to restrict *all
operators*.
On Sun, Aug 28, 2011 at 1:32 AM, Dave dave_and_da...@juno.com wrote:
@Brijesh: Maybe you mean
char *p;
p = (char*)a;
sum = (int)p[b]; // sum = a + b
but is an operator.
Dave
On Aug 27, 2:07
amazing solution Saurabh. Thanks!
--
B Anjaneyulu Reddy http://flavors.me/anjit6
+91 7259509827
On Mon, Aug 29, 2011 at 8:02 AM, saurabh singh saurab...@gmail.com wrote:
@dave even '=' is an operator.I wonder if its possible to restrict *all
operators*.
On Sun, Aug 28, 2011 at
@Saurabh: Function calls and commas are operators, so that leaves out
your clever printf solution.
See http://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B#Other_operators.
Dave
On Aug 28, 9:32 pm, saurabh singh saurab...@gmail.com wrote:
@dave even '=' is an operator.I wonder if its
@Mohit: Do you mean
int add(int a, int b)
{
if (!a)
return b;
else
return add((a b) 1, a ^ b);
}
Carries normally go to the left, not to the right.
Dave
On Aug 27, 2:28 pm, Mohit kumar lal kumarmohit...@gmail.com wrote:
int add(int a, int b)
@Brijesh: Maybe you mean
char *p;
p = (char*)a;
sum = (int)p[b]; // sum = a + b
but is an operator.
Dave
On Aug 27, 2:07 pm, Brijesh brijeshupadhyay...@gmail.com wrote:
How to add two nos without using any operator...?
--
You received this message because you are subscribed to the Google
main()
{
int a=4,b=6;
printf(\n%d\n,printf(%*s%*s,a,,b,));
}
--
Saurabh Singh
B.Tech (Computer Science)
MNNIT ALLAHABAD
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To
21 matches
Mail list logo