Back To C++ Structures
//program to create a structure to demonstrate complex number with members (real and imaginary) #include
#include
struct complex { int real; int imaginary; }; void main() { struct complex a; printf("\nenter real part of complex number "); scanf("%d",&a.real); printf("\nenter imaginary part of complex number "); scanf("%d",&a.imaginary); printf("complex number is %d +i %d",a.real,a.imaginary); getch(); }