Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Задача 1
- #include<stdio.h>
- int main() {
- float r = 0.0;
- float h = 0.0;
- printf("Enter radius and height: ");
- scanf("%f %f", &r, &h);
- printf("V=%f\n", (3.14 * r * r * h));
- return 0;
- }
- // Задача 2
- #include<stdio.h>
- int main() {
- float r = 0.0;
- float h = 0.0;
- printf("Enter radius and height: ");
- scanf("%f %f", &r, &h);
- printf("V=%f\n", (2 * 3.14 * r * r) + (2 * 3.14 * r * h));
- return 0;
- }
- // Задача 3
- #include<stdio.h>
- int main() {
- int m = 0;
- printf("Enter time in minutes: ");
- scanf("%d", &m);
- printf("Hours: %d, minutes: %d\n", (m / 60), (m % 60));
- return 0;
- }
- // Задача 4
- #include<stdio.h>
- int main() {
- float m = 0.0;
- printf("Enter mass in pounds: ");
- scanf("%f", &m);
- printf("Mass in kilos: %f\n", m * 0.4059);
- return 0;
- }
- // Задача 5
- #include<stdio.h>
- int main() {
- float d = 0.0;
- printf("Enter distance in versts: ");
- scanf("%f", &d);
- printf("Distance in kilometers: %f\n", d * 0.10668);
- return 0;
- }
- // Задача 6
- #include<stdio.h>
- int main() {
- float r = 0;
- float u = 0;
- printf("Enter resistance and voltage: ");
- scanf("%f %f", &r, &u);
- if (r != 0 ){
- printf("Strength: %f\n", u / r);
- }
- else {
- printf("Strength equals infinity\n");
- }
- return 0;
- }
- // Задача 7
- #include<stdio.h>
- int main() {
- float p = 0;
- printf("Enter price for 100 gramms: ");
- scanf("%f", &p);
- printf("Price for kilo=%f\n", 10 * p);
- return 0;
- }
- // Задача 8
- #include<stdio.h>
- int main() {
- float r1 =0;
- float r2 = 0;
- printf("Enter resistance for 1st and 2nd resistors: ");
- scanf("%f %f", &r1, &r2);
- if((r1 + r2) !=0 ){
- printf("Resistance: %f\n", (r1 * r2) / (r1 + r2));
- }
- else {
- printf("Zeo\n");
- }
- return 0;
- }
- // Задача 9
- #include<stdio.h>
- int main() {
- float a = 0;
- float b = 0;
- printf("Enter a and b: ");
- scanf("%f %f", &a, &b);
- printf("S=%f", (a * b));
- return 0;
- }
- // Задача 10
- #include<stdio.h>
- int main() {
- float m = 0;
- float p = 0;
- printf("Enter mass of apples and price for kilo: ");
- scanf("%f %f", &m, &p);
- printf("Total price=%f\n", (m * p));
- return 0;
- }
- // Задача 11
- #include<stdio.h>
- int main() {
- float s = 0;
- float b = 0;
- float p = 0;
- // printf("Enter mass of apples and price for kilo: ");
- scanf("%f %f %f", &s, &b, &p);
- if(b !=0 ){
- printf("Total price=%f\n", (2 * s) / b * p);
- }
- else {
- printf("b cannot be 0");
- }
- return 0;
- }
- // Задача 12
- #include<stdio.h>
- int main() {
- float a = 0;
- float b = 0;
- float c = 0;
- printf("Enter a, b and c: ");
- scanf("%f %f %f", &a, &b, &c);
- printf("%f", a * b * c);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement