Posts

Showing posts with the label C language coding complex number

Write a programe for complex number using C language

Image
S o, Hello guys today i will shared you about how to create a programme for complex nimber using  c programming; So, Without any click bait Let's start  Here is the source code for Complex Number Coding:  #include <stdio.h> #include <stdlib.h> struct complex {   double real, imag;       //real and imag of type double }; int main() {   int choice, a, b, z;   struct complex x, y, c;   while(1)   {   printf("Enter your choice\n");          //choices for operations     printf("Press 1. Addition.\n");     printf("Press 2. Subtra tion\n");     printf("Press 3. Multiplication\n");     printf("Press 4. Division\n");     printf("Press 5. Exit\n");     scanf("%d", &choice);     if (choice == 5)       exit(0);     if (choice >= 1 && choice <= 4)     {       p...