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 will be the output of this program main() { int i=1; while (i<=10); { i++; } }
WRITE A C PROGRAM FOR PRINT "RHOMBUS" STRUCTURE . Example: Enter the numbers :3 * * * * * * * *
What is the best style for code layout in c?
Whether there can be main inside another main?If so how does it work?
What is C language ?
What is the difference between a function and a method in c?
What is conio h in c?
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.
Explain what is operator promotion?
What is typeof in c?
if (i = 0)printf ("True"); elseprintf("False"); Under what conditions will the above print out the string "True" a) Never b) Always c) When the value of i is 0 d) all of the above
How will you print TATA alone from TATA POWER using string copy and concate commands in C?
1 Answers Amdocs, Apps Associates,