Sie sind auf Seite 1von 1

void affichecomplexe(cplx t)

{
if(t.im==0)
{
printf("z=%.0f",t.re);
}
else if(t.re==0)
{
printf("z=%.0fi",t.im);
}
else if(t.im>0)
{
printf("z=%.0f+%.0fi",t.re,t.im);
}
else if(t.im<0)
{
printf("z=%.0f%.0fi",t.re,t.im);
}

}
int main()
{
cplx a;
printf("partie reel du nombre complexe\n");
scanf("%f",&a.re);
printf("partie imaginaire du nombre complexe\n");
scanf("%f",&a.im);
affichecomplexe(a);
return 0;
}

Das könnte Ihnen auch gefallen