Breaking News

C code for Addition of two complex number

#include<stdio.h>
#include<conio.h>
 struct com
 {
  int a,b;
  int x,y;
  int add1,as;
  }c;
  void main()
  {
   clrscr();
   printf("enter 1st  part of comlex number");
   scanf("%d%d",&c.a,&c.b);
   printf("enter imaginary part of number\n");
   scanf("%d%d",&c.x,&c.y);
   printf("Number are=%5d+i%d\n",c.a,c.x);
   printf("Number are=%5d+i%d",c.b,c.y);
     c.add1=c.a+c.b;
     c.as=c.x+c.y;

   printf("Addition are=%5d+i%d",c.add1,c.as);
   getch();
   }

No comments