Float A, B, C; printf("A:")
Download 12.14 Kb.
|
1. #include #include int main(void) { float A, B, C; printf("A:"); scanf ("%f", &A); printf("B:"); scanf ("%f", &B); printf("C:"); scanf ("%f", &C); float AC = abs(A-C); printf("AC:%f\n",AC); float BC = abs(B-C); printf("BC:%f\n",BC); printf("AC+BC:%f\n",AC*BC); return 0; } 2. #include int main(void) { int a1, a2, a3; printf("1:"); scanf ("%i", &a1); printf("2:"); scanf ("%i", &a2); printf("3:"); scanf ("%i", &a3); if (a2==a3) printf("%i\n",1); else if (a1==a3) printf("%i\n",2); else printf("%i\n",3); return 0; } 6. #include float circles(float r){ return 3.14*r*r; } int main(void) { int i;
for(i=1; i<=3; ++i){ float r;
printf("R:"); scanf("%f", &r); printf("S:%f\n",circles(r)); }
} Download 12.14 Kb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling