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...


c program to subtract between two numbers without using '-'
sign and subtract function.

Answers were Sorted based on User's Feedback



c program to subtract between two numbers without using '-' sign and subtract function...

Answer / davic uwihoreye

Write a c program or code to subtract two numbers without
using subtraction operator


#include<stdio.h>

int main(){

int a,b;
int sum;

printf("Enter any two integers: ");
scanf("%d%d",&a,&b);

sum = a + ~b + 1;

printf("Difference of two integers: %d",sum);

return 0;
}

Sample Output:

Enter any two integers: 5 4
Difference of two integers: 1

Is This Answer Correct ?    9 Yes 1 No

c program to subtract between two numbers without using '-' sign and subtract function...

Answer / 080132

Do anybody give correct ans

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More C Interview Questions

how to count no of words,characters,lines in a paragraph.

0 Answers  


what are the difference between ANSI C and Let Us c and Turbo C

4 Answers   LG Soft,


What is ponter?

0 Answers   TCS,


Difference Between embedded software and soft ware?

1 Answers   Bosch,


GIVEN A FLOATING POINT NUMBER HOW IS IT ACTUALLY STORED IN MEMORY ? CAN ANYONE EXPLAIN?? THE 32 BIT REPRESENTATION OF A FLOATING POINT NUMBER ALLOTS: 1 BIT-SIGN 8 BITS-EXPONENT 23 BITS-MANTISSA

0 Answers  


the question is that what you have been doing all these periods (one year gap)

0 Answers   HCL,


Write a program to print factorial of given number without using recursion?

0 Answers  


What are local static variables? How can you use them?

0 Answers  


what is the output for this question: main() { int i=1; printf("%d%d%d",i,i++,++i); }

9 Answers  


What does the format %10.2 mean when included in a printf statement?

0 Answers  


Write the test cases for checking a variable having value in range -10.0 to +10.0?

0 Answers   Bosch,


What is static and auto variables in c?

0 Answers  


Categories