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 |
#include<string.h> void main() { String s1[]={"swathi"}; string s2[]={"maddimsetti"}; s1[]=s[]; printf("%s",s1[]); }
What is pass by reference in functions?
What do you mean by command line argument?
What is the difference between array and linked list in c?
What should malloc() do?
Why doesn't the code "a[i] = i++;" work?
Is there anything like an ifdef for typedefs?
Explain what is operator promotion?
How can you increase the allowable number of simultaneously open files?
Write a program using bitwise operators to invert even bits of a given number.
What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?
One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.