C code:

1.

#include<stdio.h>

1.

**Adding two complex numbers in c**
2.

3. **C program for addition of two complex numbers****C program to add two complex numbers**

#include<stdio.h>

int main(){

int a,b,c,d,x,y;

printf("\nEnter the first complex number:");

scanf("%d%d",&a,&b);

printf("\nEnter the second complex number:");

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 ");

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 ");

x=a-c;

y=b-d;

if(y<0)

printf("%d-i%d",x,-y);

else

printf("%d+i%d",x,+y);

return 0;

}

Does multiplication of complex number programing diifers from addition ? since it leads to squaring of variable whats the logic of program.

ReplyDeleteif(b<0) x="a+c;" y="b+d;">0)

ReplyDeletedoesnt work?

"nonportable pointer conversion"

&

"statment missing ;"

sorry im just a begginer at C n would like to understand.

hi Pard

ReplyDeleteYour code has some syntactical error. So first you should read c tutorial of this blog

hi Priya

ReplyDeleteAddition of two matrix is very simple compare to multiplication.

For addition of two matrix of take two for loop add each element of one matrix with corresponding element of other matrix one by one and store in another two dimensional array.

a[i][j]=b[i][j]+c[i][j]

At our department store you can reveal sundry medication and of progression such lay Discount Viagra Pharmacy On-line the same – Cheap Generic Viagra pharmacy.

ReplyDelete...please where can I buy a unicorn?

ReplyDeleteIl n'y a d'aucun sens. cialis cialis

ReplyDeleteI didn't understand any thing can any one explain.

ReplyDeletehttp://cprogramstores.blogspot.in/p/homepage.html

ReplyDelete