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 |
What is a const pointer?
to get a line of text and count the number of vowels in it
write a program to rearrange the array such way that all even elements should come first and next come odd
What is void c?
write a program that prints a pascal triangle based on the user input(like how many stages) in an efficient time and optimized code?
What will be your course of action for a push operation?
What functions are in conio h?
LOGIC OF Bodmas?
Is main a keyword in c?
Can anyone help me with this please? Need to print the below values.. Thanks 1 1 2 1 2 3 1 2 3 4
write a own function to compare two strings with out using stringcomparition function?
console I/O functions means a) the I/O operations done on disk b) the I/O operations done in all parts c) the input given through keyboard is displayed VDU screen d) none of the above