![](https://csdnimg.cn/release/download_crawler_static/88439396/bg1.jpg)
3414_E01 zip
Exercise 1: Programmi ng En vir onment and Basic In put/Output
1. Write a program that prints This is myfirst program! on the scree n
(a) Save this program on to your own disk with the n ame of e2-1a;
(b) R un this program without ope ning Turbo C;
(c) Modify this program to print This is my second program! , then
save it as e2-1b Please do not overwrite the first program
2. Write a program that prints the number 1 to 4 on the sameline Write the
program using the follow ing methods:
(a) Using four printf statements
(b) Using one printf statement with no conversion specifier (i
e no
%
)
(c) Using one printf statement with four conversion specifiers
3. (a) Write a program that calculates and displays the number of minutes in 15
days
(b) Write a program that calculates and displays how many hours 180
minu tes equal to
(c) (Optio nal) How about 174 minu tes?
Exercise 2: Data Types and Arithmetic Operati ons
1. You purchase a laptop puter for $889 The sales tax rate is 6 percent
Write and execute a C program that calculates and displays the total purchase
price (net price + sales tax)
2. Write a program that reads in the radius of a circle and prints the
circle s diameter, circumferenee and area Use the value 3 14159
for
3. Write a program that reads in two numbers: an account balanee and an
annual interest rate expressed as a percentage Your program should the n
display the new bala nee after a year There are no deposits or withdraws just
the interest payment Your program should be able
to reproduce the followi ng sample run:
In terest calculati on program
Starti ng bala nee? 6000 Annual interest rate percentage? 4 25
Bala nee after one year: 6255 00
Exercise 3: Seleetio n structure
1. Write a Cprogram that accepts a stude nt 's nu merical grade, eon verts the nu
merical grade to Passed (grade is betwee n 60-100), Failed
(grade is between 0-59), or Error (grade is less than 0 or greater than 100)
2. Write a program that asks the user to enter an integer number, then
ls the user whether it is an odd or eve n nu mber
3. Write a program that reads in three in tegers and the n determ ines