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
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++;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.