Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main() {
- float Tc, Tf;
- char op;
- printf_s("w jakich stopniach podajesz temperature? (C lub F)");
- scanf_s("%c", &op);
- switch (op)
- {
- case 'C':
- {
- printf_s("Podaj temp w st C: ");
- scanf_s("%f", &Tc);
- Tf = 9 / 5.0*Tc + 32;
- printf_s("%f", Tf);
- }
- break;
- case 'F':
- {
- printf_s("Podaj temp w st F: ");
- scanf_s("%f", &Tf);
- Tc = 5/9.0*(Tf - 32);
- printf_s("%f", Tc);
- }
- break;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement