Saturday, February 21, 2015

Lesson 4: Write a program manolo in the sphere radius, calculate manolo and print out the area, th


Lesson 3: Write a program to read two integers and print out the result of the (+), subtraction (-), multiplication (*) division (/). Comment manolo 2 integer division results. int main () {int a, b, c; printf ("Enter the number a:"); scanf ("% d", & a); printf ("Enter the number b"); scanf ("% d", & b); printf ("Addition:% d% d =% d cong \ n", a, b, a + b); printf ("subtraction:% d% d =% d Stay \ n", a, b, ab); printf ("Multiplication:% d% d face =% d \ n", a, b, a * b); printf ("phap share:% d% d =% d split \ n", a, b, a / b); return 0; }
Lesson 4: Write a program manolo in the sphere radius, calculate manolo and print out the area, th In order that the volume of a sphere. Guidelines: S = 4πR 2 and V = (4/3) πR 3. int main () {float r, S, V; printf ("click of radius r:"); scanf ("% manolo f", & r); S = 4 * r * r * 3:14; V = (4/3) * 3.14 * r * r * r; printf ("area of the sphere is:% .2f. \ n", s); printf ("The volume of the sphere is:% .2f. \ n", V); return manolo 0; }
Lesson 5: Write a program in any one of a print and squared value (a 2), cube (a third) of a value and a 4. Note: this section manolo you must add #include manolo <math.h> to use the function pow! int main () {double a; printf ("the values to a:"); manolo scanf ("% f", & a); printf ("a ^ 2 =% f \ n", pow (a, 2)); printf ("a ^ 3 =% f \ n", pow (a, 3)); printf ("a ^ 4 =% f \ n", pow (a, 4)); return 0; }
Lesson manolo 6: Write a program that reads from the keyboard 3 integer representation day, month, year and appears on-screen as a "right / month / year" (just take the last two numbers of the year). int main () {int day, month, male; printf ("right click"); scanf ("% d", manolo & right); printf ("Enter in the elevator:"); scanf ("% d ', & scale); printf ("The Click Five"); scanf ("% d", & male); printf manolo ("%. 2d /%. 2d /%. 2d \ n", right, scale, 100% male); manolo return 0; }
Last 7. Write a program in seconds, from 0 to 86 399, change the number of seconds into the format "HH: mm: ss", each component is a 2-digit integer. int main () {int Shine; printf ("Enter the number Shine"); scanf ("% d", & Shine); manolo if (Shine> 86399) {printf ("Enter the smaller \ n"); manolo return manolo 0; } Int = gio Shine / 3600; int = Minute Shine / 60 - gio * 60; Shine Shine = - * 60 mins - gio * 3600; printf ("%. 2d:%. 2d:%. 2d", hour, minute, seconds); return 0; }
You are commenting using của Google+ account. (Log Out / Change)
% D and bloggers like this:

No comments:

Post a Comment