write a C Program to find addition and subtraction of complex numbers
itstudentjunction
advertising
write a c program to find addition and subtraction of two complex numbers
complex number:
A complex number is a number that can be put in the form a + bi, where a and b are real numbers and i is called the imaginary unit, In a + ib, a is called the real part and b the imaginary part of the complex number.
Write a c program to find addition and subtraction of complex numbers or add, subtract two complex numbers or print addition and subtraction of complex numbers or show addition and subtraction of complex numbers
//Write a c program to find addition and subtraction of complex numbers or add, subtract two complex numbers or print addition and subtraction of complex numbers or show addition and subtraction of complex numbers
#include<stdio.h>
int main(){
int a,b,c,d,x,y;
printf("\nTo add subtract two complex numbers \n:");
printf("\nEnter the first complex number a & b values:");
scanf("%d%d",&a,&b);
printf("\nEnter the second complex number a & b values:");
scanf("%d%d",&c,&d);
if(b<0)
printf("%d-i\n",a-b);
else
printf("d+i\n",a+b);
if(d<0)
printf("d-i\n",c-d);
else
printf("%d+i\n",c+d);
printf("\nADDITION OF TWO COMPLEX NUMBERS IS");
x=a+c;
y=b+d;
if(y>0)
printf("%d-i%d",x,-y);
else
printf("%d+i%d",x,+y);
printf("\n\nSUBTRACTION OF TWO COMPLEX NUMBERS IS ");
x=a-c;
y=b-d;
if(y<0)
printf("%d-i%d",x,-y);
else
printf("%d+i%d",x,+y);
return 0;
}
output:
To add subtract two complex numbers
Enter the first complex number a & b values:
4 5
Enter the second complex number a & b values:
2 3
ADDITION OF TWO COMPLEX NUMBERS IS 6 + 8i
SUBTRACTION OF TWO COMPLEX NUMBERS IS 2 + 2i
some related programs:
write a c program to show multiplication of complex numbers
Write a c program to find addition and subtraction of complex numbers or add subtract two complex numbers
write a c program to find addition sparse matrix or add sparse matrices or find sum of sparse matrices
write a c program for addition of two matrices or add two matices or find sum of two matrices

write a c program to find check calculate print show SI write a c program to find check calculate print show CI write a c program to find check calculate print show factorial number write a c program to find check print show even / odd write a c program to find check print show perfect number or not write a c program to find check print show prime number or not write a c program to find check calculate print show factors of number write a c program to find check print show prime factors write a c program to find check calculate print show armstrong number or not write a c program to find check calculate print show amicable pair write a c program to find check calculate print show sum of n numbers write a c program to find check calculate print show average of n numbers write a c program to find check calculate print show largest of two numbers write a c program to find check calculate print show largest of n numbers write a c program to find check calculate print show LCM of two numbers write a c program to find check calculate print show GCD of two numbers write a c program to find check calculate print show sum of n numbers write a c program to find check calculate print show numbers in word write a c program to find check calculate print show pascal Triangle find roots write a c program to find check calculate print show addition subtraction of complex numbers write a c program to find check calculate print show multiplication of complex numbers write a c program to find check calculate print show numbers pyramid write a c program to find check calculate print show decimal to binary write a c program to find check calculate print show decimal to octal write a c program to find check calculate print show decimal to hexadecimal sum of digits towers of hannoi write a c program to find check calculate print show palindrome number write a c program to find check calculate print show strong number or not biggest of three largest & smallest values in array combinations no.of digits permutations prime numbers power value reverse number smallest number in array sum of Digits Floydâ€™s Triangle even or odd swap numbers implementing function implementing function Function with no arguments and a return value function with no arguments and no return value addition of two matrices multiplication of two matrices transpose of matrix inverse of matrix lower triangle upper triangle sparse matrix addition two sparse matrix multiply sparse matrix SI using macros max min values gcd using recurrsion fibonacci numbers factorial using recurrsion sum of factorial series reverse number sizes data types automatic variable scope external variable scope static variable scope register variable scope employee data reverse string strrev reverse string pointers reverse string arrays string length strlen string length arrays string length pointers concatinate strings strCat concatinate strings arrays convert to lowercase convert to uppercase convert to lowercase
check substring first occurance of character count words count vowels compare two strings arrays compare strings pointers compare strings strcmp palindrome string substring position string combinations acromatic string rain drop character copy file student records in file line styles fill styles font styles escape operators B-TREE MULTIWAY TREE AVL TREE SPLAY TREE RED BLACK TREE HASHING PRIORITY QUEUE DIJKSTRA'S ALGORITHM KNAPSACK PROBLEM ADJACENCY LIST DEPTH FIRST SEARCH MINIMAL SPANNINGTREE KRUSKAL'S ALGORITHM MINIMAL SPANNING TREE PRIMS ALGORITHM BREADTH FIRST SEARCH LINEAR SEARCH POINTERS BINARY SEARCH POINTERS LINEAR SEARCH ARRAYS BINARY SEARCH ARRAYS BUBBLE SORTARRAYS MERGE SORT ARRAYS SELECTION SORT ARRAYS INSERTION SORT ARRAYS TOPOLOGICAL SORT ARRAYS HEAP SORT ARRAYS HEAP SORT POINTERS BUBBLE SORT arrays MATRIX MULTIPLICATION TRANSPOSE OF MATRIX LEXICOGRAPHIC ORDER SUBSTRING its POSITION CONCATENATE STRINGS STUDENT INFORMATION MULTIPLY SPARCE MATRICES COUNT STRINGS LINKED LIST POINTERS REVERSE STRING PREFIX TO POSTFIX SINGLE LINKED LIST COUNT NODES LINEAR LINKED LIST CIRCULAR LINKED LIST CONCATENATE LISTS PRINT LIST ELEMENTS COMMON IN TWO LISTS SORT LIST CIRCULAR LINKED LIST REVERSE LINKED LIST SHOW POLYNOMIAL ADD POLYNOMIALS STACK ARRAYS STACk (pointers) MULTIPLE STACK EXPRESSION TREE TRAVERSALS INFIX TO POSTFIX QUEUE ARRAYS QUEUE POINTERS CIRCULAR QUEUE ARRAYS QUEUE USING ARRAYS REVERSE A QUEUE BINARY TREE BINARY TREE TRAVERSALS LEAVES OF BINARY TREE first occurrence of substring last occurrence of substring check substring C Programs Data structures Programs in c Data structures Programs in c++ Computer Graphics Programs Unix commands Linux commands HTML programming C++ programs ,Data structures Algorithms , Java Programs UML Diagrams Assembly Language Programs DBMS j2ee programming c tutorials c++ tutorials java tutorials Data structures tutorials DBMS tutorials