Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<string.h>
- void c2f(float c){
- float f;
- f=c*(9.0/5.0)+32.0;
- printf("%f stopni Celsjusza to %f stopni Fehrenheita\n",c,f);
- }
- void f2c(float f){
- float c;
- c=(f-32.0)*(5.0/9.0);
- printf("%f stopni Fehrenheita to %f stopni Celsjusza\n",f,c);
- }
- void wybor(int i){
- float x;
- printf("Podaj temperature :\n");
- scanf("%f", &x);
- if (i==0){
- c2f(x);
- }
- else{
- f2c(x);
- }
- }
- main(){
- printf("*********************** Konwerter temperatur ***********************\n");
- int i;
- printf("Wpisz 0 zeby zamienic stopnie Celsjusza na stopnie Fehrenheita, wpisz 1 zeby zamienic stopnie Fehrenheita na stopnie Celsjusza:\n");
- scanf("%d", &i);
- wybor(i);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement