see the changes below

Code:
//This program prints the initialized value of two complex numbers and allows
//the user to change the values of the real and imaginary numbers of the two
//complex numbers. This program can also solve the sum and the product of the
//two complex numbers and display all the complex numbers in the program.

#include<stdio.h>  
#include <conio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>

typedef struct CN{
  double cxr,cyr,czr;
  double cxi,cyi,czi;
  }CN;

CN * Sum(CN *CN1){
  CN1->czr=CN1->cxr+CN1->cyr;
  CN1->czi=CN1->cxi+CN1->cyi;
  return CN1;
  }
CN * Mul(CN *CN1){
  double a,b,c,d;
  a=CN1->cxr*CN1->cyr;
  b=CN1->cxr*CN1->cyi;
  c=CN1->cxi*CN1->cyr;
  d=-1.0*(CN1->cxi*CN1->cyi);
  CN1->czr=a+d;
  CN1->czi=b+c;
  return CN1;
  }

void DisplayCN(CN *p);

int main(void){
  CN *ptr;
  char error[128];
  int selection;
  ptr=(CN *) malloc(sizeof(CN));
  ptr->cxr=1.0;//first number
  ptr->cxi=-2.0;
  
  ptr->cyr=3.0;//second number
  ptr->cyi=4.0;

  do{
    system("cls");
    printf("The Starting Values:\n");
    printf("CN1: %.2f%+.2fi\n",ptr->cxr,ptr->cxi);
    printf("CN2: %.2f%+.2fi\n\n",ptr->cyr,ptr->cyi);
    printf("Complex Number Selection Screen\n\n");
    printf("First Complex Number:\n");
    printf("1 - Change the Value of the Real Number\n");
    printf("2 - Change the Value of the Imaginary Number\n\n");
    printf("Second Complex Number:\n");
    printf("3 - Change the Value of the Real Number\n");
    printf("4 - Change the Value of the Imaginary Number\n\n");
    printf("Complex Number Operations:\n");
    printf("5 - Add the two Complex Numbers\n");
    printf("6 - Multiply the two Complex Numbers\n");
    printf("7 - Display all the Complex Numbers\n");
    printf("8 - Exit\n");
    fgets(error,128,stdin);
    selection=atoi(error);
    switch(selection){
      case 1:
        system("cls");
        printf("Change the Value of the Real Number\n");
        printf("CN1: %.2f%+.2fi\n",ptr->cxr,ptr->cxi);
        printf("New Value for the Real Number: ");
        scanf("%lf",&ptr->cxr);//CN1.cxr);
        getchar();
        getche();
        break;
      case 2:
        system("cls");
        printf("Change the Value of the Imaginary Number\n");
        printf("CN1: %.2f%+.2fi\n",ptr->cxr,ptr->cxi);
        printf("New Value for the Imaginary Number: ");
        scanf("%lf",&ptr->cxi);//CN1.cxi);
        getchar();
        getche();
        break;
      case 3:
        system("cls");
        printf("Change the Value of the Real Number\n");
        printf("CN2: %.2f%+.2fi\n",ptr->cyr,ptr->cyi);
        printf("New Value for the Real Number: ");
        scanf("%lf",&ptr->cyr);//CN1.cyr);
        getchar();
        getche();
        break;
      case 4:
        system("cls");
        printf("Change the Value of the Imaginary Number\n");
        printf("CN2: %.2f%+.2fi\n",ptr->cyr,ptr->cyi);
        printf("New Value for the Imaginary Number: ");
        scanf("%lf",&ptr->cyi);//CN1.cyi);
        getchar();
        getche();
        break;
      case 5:
        system("cls");
        printf("Sum of the Complex Numbers\n");
        ptr=Sum(ptr);
        printf("The Sum of the Complex Numbers is %.2f%+.2fi\n",ptr->czr,ptr->czi);
        getche();
        break;
      case 6:
        system("cls");
        printf("Product of the Complex Numbers\n");
        ptr=Mul(ptr);
        printf("The Product of the Complex Numbers is %.2f%+.2fi\n",ptr->czr,ptr->czi);
        getche();
        break;
      case 7:
        system("cls");
        DisplayCN(ptr);
        break;
      case 8:
        exit(1);
        break;
      default:
        system("cls");
        printf("Invalid input. Please try again!!!\n");
        printf("Please press the spacebar to continue!!");
        getche();
        break;
    }
  }while(selection!=8);
}

void DisplayCN(CN *p){
  printf("The Values of the Complex Numbers:\n");
  printf("CN1: %.2f%+.2fi\n",p->cxr,p->cxi);
  printf("CN2: %.2f%+.2fi\n\n",p->cyr,p->cyi);
  printf("Sum of the Complex Numbers\n");
  p=Sum(p);
  printf("%.2f%+.2fi\n\n",p->czr,p->czi);
  printf("Product of the Complex Numbers\n");
  p=Mul(p);
  printf("%.2f%+.2fi\n",p->czr,p->czi);
  getche();
  }
askmewhy25 like this