mirror of
https://github.com/ada-dmitry/TMP_C712.git
synced 2026-09-24 09:10:16 +00:00
added more task
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
#include <stdio.h>
|
||||
|
||||
float fahr(int cel)
|
||||
{
|
||||
float res;
|
||||
|
||||
res = cel * 9 / 5 + 32;
|
||||
|
||||
return res;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#include <stdio.h>
|
||||
#include "func.c"
|
||||
|
||||
float fahr(int cel);
|
||||
|
||||
int main()
|
||||
{
|
||||
int cel; // градусы Цельсия
|
||||
float f; // градусы Фаренгейта
|
||||
|
||||
scanf("%d", &cel);
|
||||
f = fahr(cel);
|
||||
printf("%.2f\n", f); // .2f - печатать с точностью до 2 знаков после .
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user