SCHOOL OF CODE BUILDERS
Learn To CODE. Become A DEVELOPER.
Pages
HOME
DATA STRUCTURES
STRINGS
ARRAYS
MATRIX
BINARY TREES
LINKED LIST
STACK
QUEUE
SORTING
SEARCHING
C
PYTHON
PSEUDOCODE
CONTEST PROBLEMS
ALGORITHMS
PATTERNS
PHP
C PUZZLES
C INTERVIEW QUESTIONS
JAVA
C++
HASHING
RECURSION
BASIC C PROGRAMS
TCS-CODEVITA
FACEBOOK
CONTACT US
C program to calculate a^b
C program to calculate a^b
Output:
Enter the number a: 5
Enter the number b: 5
The ex-or product of 5 ^ 5 is 0
Implementation:
/* If you want to find pow(a,b) or a raised to the power of b visit the link: http://www.coderegister.co.in/2015/09/c-program-to-find-nth-power-of-number.html Else if you want to find the ex-or product of a and b go on reading the following article EX-OR TABLE: ----------- A B A^B ------------ 0 0 0 0 1 1 1 0 1 1 1 0 */ #include
int main(void) { int a,b; printf("Enter the number a:\n"); scanf("%d",&a); printf("Enter the number b:\n"); scanf("%d",&b); printf("The ex-or product of %d ^ %d is %d",a,b,(a^b)); return 0; }
PREVIOUS
NEXT
HOME