Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write C programs for the following 1. Write a function to ask to user a number of elements, create random decimal numbers ranging between -3

image text in transcribed

Write C programs for the following 1. Write a function to ask to user a number of elements, create random decimal numbers ranging between -3 to 4 and write them into file called "data.txt", seperated by commas. Hint: Use a for loop 2 Using structures and typedef discussed in the #101ecture write a program to do complex division between two complex numbers. 1 e z As a demonstration. compute z1z2 wherez,-2.12 + 1.21 i and z2-2.8 + 7.81. The following program computes the product of two complex numbers So you may want to write a program like #include include typedef struct (float Real; float Im;] Complex; typedef struct (float Real; float Im; Complex; Complex ComplexMultiply(Complex 21, Complex 22) Complex ComplexDivide(Complex z1, Complex z2) Complex Z; Complex Z; z.Real -/*your own code Z.Im *your own code* return z; z 1 . Real*22 . Im Z; 21 . 1m*22 . Real ; 2. Im = return + int main() int main() Complex z1, z2, z; Complex 21,z2,z; :1-Real-0.25; z1.1m=-3.1412; z2-Real-0.98; z2.1m=1.655; z=ComplexMultiply(zl,22); z1.Real--0.8; z1.Im-2.4; z2.Real-3.1; Z2.Im--5.6; /*Your Own code to computer z1/z2 here / by 7:04 PM printf("The product of z2 %f %f 1. ", z.Real, z.1m); Li 10/13/2017 z1 * + return printf(":1 divided z2 is %f + %f 1 . n", z.Real, z.In); return e

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases On The Web Designing And Programming For Network Access

Authors: Patricia Ju

1st Edition

1558515100, 978-1558515109

More Books

Students also viewed these Databases questions