c program to subtract between two numbers without using '-'
sign and subtract function.
Answers were Sorted based on User's Feedback
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 |
how to count no of words,characters,lines in a paragraph.
what are the difference between ANSI C and Let Us c and Turbo C
What is ponter?
Difference Between embedded software and soft ware?
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
the question is that what you have been doing all these periods (one year gap)
Write a program to print factorial of given number without using recursion?
What are local static variables? How can you use them?
what is the output for this question: main() { int i=1; printf("%d%d%d",i,i++,++i); }
What does the format %10.2 mean when included in a printf statement?
Write the test cases for checking a variable having value in range -10.0 to +10.0?
What is static and auto variables in c?