CALCU COMPLEJOS
Enviado por angelzero10 • 27 de Agosto de 2013 • 387 Palabras (2 Páginas) • 368 Visitas
#include <stdio.h>
#include <stdlib.h>
struct complejos{
float real,im; //numeros complejos (2float)
};
void suma ( complejos arr[], int longitud );//prototipo de funcion
void resta ( complejos arr[], int longitud );//prototipo de funcion
void divicion ( complejos arr[], int longitud );//prototipo de funcion
void multiplicacion ( complejos arr[], int longitud );//prototipo de funcion
main(){
int n,i, opcion;
float aR,bI;
printf("cuantos numeros tienes?");
scanf("%d",&n);
complejos c[n];//se ingresan n numeros complejos
for(i=0;i<n;i++){
printf("\nDame la parte real del numero %d",i+1);
scanf("%f",&c[i].real);
printf("\nDame la parte imaginaria del numero %d",i+1);
scanf("%f",&c[i].im);
}
system ("cls");
printf("*****MENU******\n");
printf("1. Suma \n");
printf("2. resta \n");
printf("3. multiplicacion \n");
printf("4. divicion \n");
scanf("%d", &opcion);
if(opcion ==1)// suma
{
suma( c, n );
}
if(opcion ==2)//resta
{
resta(c,n);
}
if(opcion ==3)//multiplicacion de complejos
{
resta(c,n);
}
if(opcion ==4)//divicion de complejos
...