assignment03

# assignment03 - the triangle is equilateral(b the triangle...

This preview shows page 1. Sign up to view the full content.

ECE 175 - Computer Programming for Engineering Applications Assignment #3 Due on September 25, 2008 [Thursday] by 11.59 PM. Note that this assignment can be solved in groups of two students. It is su cient to submit one assignment per group. Please make sure every program contains the name of both the students in the group. Reading assignment: Chapters covering functions, math library, and conditional statements. 1. Write a program num-digits.c which takes a decimal positive integer x . The program prints the number of digits required to represent the decimal integer x in bases 2, 4, 8, and 16. For example: If the input is 18, then the output should be: Given decimal number: 18 Number of digits required in base 2: 5 Number of digits required in base 4: 3 Number of digits required in base 8: 2 Number of digits required in base 16: 2 2. Write a program that takes three distance values a, b, and c and identifies if a triangle can be formed whose sides have the three given lengths. If a triangle can be formed, then if the triangle satisfies the following properties: (a)
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: the triangle is equilateral; (b) the triangle is isosceles (if it is not equilateral); and (c) the triangle is a right-angled triangle. Your output should appear as below, with the correct answer printed for each question. Can a triangle can be formed with the given lengths? Yes / No Is the triangle equilateral? Yes / No / Not applicable If the triangle is not equilateral, it is isosceles? Yes / No / Not applicable Is the triangle right-angled? Yes / No / Not applicable Call this program triangle.c. 3. Write a program that takes a two-digit integer (-99 to +99) as an input and outputs the number in words. If the input is outside this range, the program should print that it is outside the range. Use switch statement when you want to check equality and if statement if you are checking for range. Call this program number-words.c. Turnin Instructions Turnin the “C” program ±le using the following statement. turnin ece175 assignment3 num-digits.c triangle.c number-words.c...
View Full Document

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern