Advertisement
Guest User

talha

a guest
Oct 14th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.38 KB | None | 0 0
  1. #include <stdio.h>
  2. int main()
  3. {
  4.     int choice;
  5.     float temp,value;
  6.     printf("Enter your temperature:");
  7.     scanf("%f",&temp);
  8.     printf("Enter your choice:");
  9.     scanf("%d",&choice);
  10.     if(choice==1)
  11.     {
  12.         value=((temp-32)*5)/9;
  13.     }
  14.    else if(choice==2)
  15.     {
  16.         value=(9*temp)/5+32;
  17.     }
  18.     printf("result is=%.2f\n",value);
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement