Asked in Honeywell Technical Interview:
C Program to add, subtract, multiply and divide complex numbers :- This program performs basic operations on complex numbers i.e addition, subtraction, multiplication and division. This is a menu driven program in which user will have to enter his/her choice to perform an operation. User can perform operations until desired. To easily handle a complex number a structure named complex has been used, which consists of two integers first integer is for real part of a complex number and second for imaginary part.
#include
#include
#include
struct complex
{
int real;
int img;
};
main()
{
int choice, temp1, temp2, temp3;
struct complex a, b, c;
while(1)
{
clrscr();
printf("Press 1 to add two complex numbers.\n");
printf("Press 2 to subtract two complex...