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

explain what are actual arguments?

1087


What does 2n 4c mean?

1231


Is fortran still used today?

1090


Under what circumstances does a name clash occur?

1200


How do you determine the length of a string value that was stored in a variable?

1121


How can I change their mode to binary?

1110


Can we assign integer value to char in c?

1246


What are the two types of structure?

1084


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

1072


What are the preprocessor categories?

1057


What is nested structure in c?

1060


How a string is stored in c?

1068


What is the difference between pure virtual function and virtual function?

1119


what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?

2379


Why do we use header files in c?

1070