difference of two no's with out using - operator

Answer Posted / sandeep

int count(int a , int b)
{
int c=0;
if(a<b)
for(i=a;i<=b;i++)
{
c++;
}
else
for(i=b;i<=a;i++)
{
c++;
}
return(c); }

www.NSITFORUM.co.cc

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I read in an object file and jump to locations in it?

573


please explain every phase in the "SDLC" in the dotnet.

2175


How do I copy files?

619


disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit

1623


I have seen function declarations that look like this

598






How do I determine whether a character is numeric, alphabetic, and so on?

620


Explain what is operator promotion?

631


What is self-referential structure in c programming?

655


How do I get an accurate error status return from system on ms-dos?

643


How the c program is executed?

629


Explain the difference between ++u and u++?

633


What does != Mean in c?

582


pierrot's divisor program using c or c++ code

1724


Explain what is meant by 'bit masking'?

640


Why do we use pointer to pointer in c?

593