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

Here is a good puzzle: how do you write a program which produces its own source code as output?

1080


When should you not use a type cast?

1112


What is data structure in c language?

1093


plz let me know how to become a telecom protocol tester. thank you.

2181


Explain how do you search data in a data file using random access method?

1121


On most computers additional memory that is accessed through an adapter of feature card along with a device driver program. a) user memory b) conventional memory c) expandedmemory d) area

1103


write a program that types this pattern: 12345678987654321 12345678 87654321 1234567 7654321 123456 654321 12345 54321 1234 4321 123 321 12 21 1 1

3923


Why should I use standard library functions instead of writing my own?

1252


How we can insert comments in a c program?

1109


What is meant by preprocessor in c?

1000


Do you know what are bitwise shift operators in c programming?

1090


Write a program to implement queue.

1099


What are the functions to open and close file in c language?

1189


what is the structure pointer?

2109


Write a program to check palindrome number in c programming?

1004