Answer to Question #27450 in C# for Jitender

Question #27450
#include<stdio.h>
#include<conio.h>
struct complex {
float real;
float image;
};
void main()
{
struct complex a,b;
input();
}
{
input()}

struct complex a,b;
int c;
printf("enter the first complex no (x+iy)\n");
scanf("%f %f \n",&a.real,&b.image);
printf("enter the 2nd complex no. (x+iy)\n");
scanf("%f %f\n",&a.real,&b.image);
while((c=getchar())!='q'){
menu();
switch(c){
case 'a':
add(a,b);
break;
case's':
sub(a,b);
break;
case'm':
mult(a,b);
break;
case'd':
div(a,b);
break;
}
}
menu()
{
printf("a=addition\n");
printf("enter an option\n");
}
add(a,b)
struct complex a,b;
{
struct complex c;
c.real=a.real+b.real;
c.image=a.image+b.image;
printf("addition of 2 complex no:\n");
output(c);
}

output(c);
struct complex c;
{
if(c.image<0)
printf("%0.2f %0.2fi\n",c.real,c.image);
else
printf("%0.2f+i%0.2f\n",c.real,c.image);
}
getch();}
not able to run the program please help!
0
Expert's answer

Answer in progress...

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS