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 the difference between the = symbol and == symbol?
Read two numbers from keyboard and find maximum of them?
Hai,I have done with my bachelor of commerce and planing to ms,please suggest me how to convince vo for shifting from commerce to computers. Visa on 8 DEC 2014 Npu university
Juxtapose the use of override with new. What is shadowing?
Given an array of characters, how would you reverse it? How would you reverse it without using indexing in the array?
Write a C function to search a number in the given list of numbers. donot use printf and scanf
Without using main fn and semicolon,print remainder for a given number in C language
What is memory leak in c?
What are enumerated types?
write a C program: To recognize date of any format even formats like "feb-02-2003","02-february-2003",mm/dd/yy, dd/mm/yy and display it as mm/dd/yy.
What are the concepts introduced in OOPs?
How do you use a 'Local Block'?