write down a display programme for complex numbers in c

 #include<stdio.h>


typedef struct complex{

int real;

int imaginaey;

}comp;


void display(comp c){

printf("Enter the valuie of real number %d\n\n",c.real);

printf("Enter the valuie of imaginary number %d\n\n",c.imaginaey);

}


int main()

{

comp complexnums[5];

for(int i=0;i<5;i++){

printf("Ente the real value for %d is num\n",i+1);

scanf("%d",&complexnums[i].real);

printf("Ente the imagenary value for %d is num\n",i+1);

scanf("%d",&complexnums[i].imaginaey);

for(int i=0;i<5;i++){

display(complexnums[i]);

}

return 0;

}

Comments

Popular posts from this blog

create a num table in a new file in c

write a programme to compare time stamp in c

write a struct programme to keep bank details in c