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's the o/p int main(int n, char *argv[]) { char *s= *++argv; puts(s); exit(0); }
Can we access RAM? How? Whats the range of access? Similarly What are other hardware we can access?
Eight queens puzzle
Write a program that can show the multiplication table.
What is the need of structure in c?
what is the basis for selection of arrays or pointers as data structure in a program
what is an array
how to convert binary to decimal and decimal to binary in C lanaguage
7 Answers BPO, Far East Promotions, IBM, RBS,
In which category does main function belong??
player is good if the following conditions are satisfied: He is either from “India”, “Japan” or “Korea” He has a minimum of 3 years of experience He has won at least 3 major tournaments, and one of them must be "World Championship Tournament". He must know more than 10 techniques. (but see next question) If he knows less than 10 techniques, then he must be a world champion. His name contains at least 3 words. For example "Sachin Tendulkar" will not meet this condition. Write a method: boolean isGoodPlayer(String name, String country, int yearsExperience, String[] majorTournamentsWon, String[] techniques, boolean isWorldChampion) name country yearsExperience majorTournamentsWon techniques isWorldChampion
what is the difference between structure and union?
What is the difference between functions getch() and getche()?