Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Only using Six Constructs 1. printf 2. scanf 3. Variables A) basic types (int, f

ID: 654152 • Letter: O

Question

Only using Six Constructs 1. printf 2. scanf 3. Variables A) basic types (int, float, double, char) B) arrays

4.Assignment Statement; Expressions 5. If (expr)-Then-Else 6. While (expr)
7- Struct

In this homework, you will design and implement C programs for simple operations involving Complex Numbers. A Complex Numbers has the form x + i.y, where 'x' is the real part, 'y' is the imaginary part, and i = V(- 1). Follow the directions for each problem to design,implement and verify your programs. Write a C program that will accept between 50 and 100 Complex Numbers via scanf function. Your program should printout all the Complex Numbers that have a positive imaginary part.

Explanation / Answer

#include <stdio.h>

Const int I= (-1) 1/2 ;

int comnum[50];

struct ComplexNo

{

int RealPart [50];

int ImaginaryPart;

}

int main ()

{

struct ComplexNo c1[50];

int realno ;

while (i <=50)

{

Printf (" Enter a number for real part");

Scanf ("%d", &RealPart[i]);

printf("Enter Imaginary Part of complex number");

Scanf ("%d", &Imaginpart);

i++;

}

ComplexNo c1[i] = RealPart[i] +Imaginpart * I;

while (i <=50)

{ If ( imaginpart >0)

printf ("Complex number with Positive imaginary part is : %d", &ComplexNo[i]);

}

i++;

}