Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

difference of two no's with out using - operator

Answer Posted / santhi perumal

#include<stdio.h>
#include<conio.h>

//To calculate a-b
void main()
{
int a,b,min,max;

printf("Enter the value of a and b \n");
scanf("%d %d",&a,&b);
min = (a<b)?a:b;
max = (a>b)?a:b;
while(min--) max--;

if(a<b)
printf("-%d",max);
else
printf("%d",max);
}

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which function in C can be used to append a string to another string?

1181


What is conio h in c?

1006


Difference between strcpy() and memcpy() function?

1075


Explain 'bit masking'?

1027


Explain modulus operator. What are the restrictions of a modulus operator?

972


Explain how do you determine a file’s attributes?

1001


I have a varargs function which accepts a float parameter?

999


What is self-referential structure in c programming?

1146


c program for searching a student details among 10 student details

2043


Is c programming hard?

973


why programs in c are running with out #include? some warnings are display in terminal but we execute the program we get answer why? eg: main() { printf("hello world "); }

1713


What does it mean when the linker says that _end is undefined?

1043


Who invented b language?

1341


What is the best way to store flag values in a program?

1012


why we wont use '&' sing in aceesing the string using scanf

2315