CSE 271: Homework 2
Assigned: 21 January
Due: 25 January
- Which of the following are invalid variable names? Why? (Put your answers in a file called hw2.txt.)
- Int
- Printf
- floating
- ReInitialize
- char
- Xx
- _1312
- _
- 6_05
- alpha-beta-count
- A$
- $B
- Write a program in C (called poly.c) to evaluate the polynomial:
4x3 - 5x2 + 9
for any value of x, which should be of type float.
- The factorial of an integer n, written n!, is the
product of the consecutive integegers 1 through n. For example,
5 factorial is calculated as
5! = 5 x 4 x 3 x 2 x 1 = 120
Write a program (called factorial10.c) that generates the appropriate output (similar to that
above), when looping through the first 10 factorials (e.g., 1!, 2!, ... 10!)..
Submission Requirements
- All three files must reside in the cse271.131/hw2 subdirectory.
You will receive an email after your assignment has been collected.
Last revised: 17 January 2013.