Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C function (Funcl) that reads inside the function two int values x and y (two angles in degree, x and y, their total

image text in transcribedimage text in transcribed

Write a C function (Funcl) that reads inside the function two int values x and y (two angles in degree, x and y, their total must be different from a + 2kt). The function will calculate and print the result (with 3 decimal-point format, i.e. 1.234) from the following equation' (do not return to the main program): f(x,y) = 2 * tan (***) 3 sin? x cosy Write a C function (Func2) that receives from the main program three pointers: an integer- pointer nPtr and two character-pointers cPtrl and cPtr2. The function will print the pattern as in the example output (do not return to the main program). Write a C recursive function (Func3) that receives from the main program a random integer N (value from 1 to 20) and returns to the main program the result of the following equation. The result will be printed with 5 decimal-point format: 1 1 1 (-1)N-1 f(N) = 1-22+33 4* + NN Write a C function (Func4) that reads inside the function three integers: in octal, in decimal and in hexadecimal with their prefixes. The function will determine the closest integer (but not greater than) to the average value of three inputs, then print a summary table as in the example output (do not return to the main program). Write a C function (Func5) that reads inside the function a 3-digit integer N (must check the condition). The function will create a new number by swapping the first and the last digit of N, then return this new number to the main program for printing. At the end, develop a C main program that reads an option (unsigned value) to call the five functions above. The program should circulate when the option value is from 1 to 5 and exit in case greater than 5. Example output: Enter an option: 1 Enter two angles (in degree): 100 80 Invalid angles x or y. Enter two angles (in degree): 240 300 Invalid angles x or y. Enter two angles in degree): 30 60 f(30,60) = 1.906 Enter an option: 2 Enter an integer N and two characters CHI, CH2:5* + ***** ****+ ***++ ** +++ +++++ Enter an option: 3 All the angles should be converted to radian before using trigonometric functions. 2 Column 1-3: 6 spaces, column 4: 8 spaces. All aligned to the left. Page 3/5 f(20) = 0.78343 Enter an option: 4 Enter three numbers in octal, decimal and hexa with prefixes: 033 57 0x4f Num1 Num2 Num3 Avg 27 57 79 54 Enter an option: 5 Enter a 3-digit integer: 12 Invalid. Enter a 3-digit integer: 135 New number: 5314 Enter an option: 10 Program ends here

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

Fundamentals Of Database Systems

Authors: Sham Navathe,Ramez Elmasri

5th Edition

B01FGJTE0Q, 978-0805317558

More Books

Students also viewed these Databases questions

Question

=+to live and work wherever he or she wants?

Answered: 1 week ago

Question

=+How will this affect the recruiting process?

Answered: 1 week ago