Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.72 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.    
  6.  
  7.     char a;
  8.     int b, c;
  9.  
  10.     do {
  11.  
  12.  
  13.     printf("1. Zamiana stopni celcjusza na kelviny \n");
  14.     printf("2. Zamiana stopni kelvina na celcjusza \n");
  15.     printf("3. Wyjscie \n");
  16.  
  17.    
  18.  
  19.    
  20.  
  21.     scanf("%s", &a); /* a = getch(); */
  22.    
  23.     switch(a)  
  24.    
  25.    
  26.         {
  27.    
  28.             case '1': printf("Podaj temperature w stopniach celcjusza \n");
  29.                   scanf("%d", &b);
  30.                   printf("Temperatura w stopniach kelvina wynosi %d\n" , b + 273 );
  31.                   break;
  32.  
  33.             case '2': printf("Podaj temperature w stopniach kelvina \n");
  34.                   scanf("%d", &b);
  35.                   printf("Temperatura w stopniach celcjusza wynosi %d\n" , b - 273 );
  36.                   break;
  37.             case '3': system ("pause");
  38.                   return 0;
  39.         }
  40.       }
  41.     while ( a != 3);
  42.    
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement