Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * temp.c
- *
- * Copyright 2011 Aivaras Kivilius <aivaras@Area51>
- */
- #include <stdio.h>
- int main(int argc, char **argv)
- {
- int tempC;
- int tempF;
- int var;
- int temp;
- printf("You have F(type 0) or C (type 1)?\n");
- scanf ("%d",&var);
- printf("Temperature:\n");
- scanf ("%d", &temp);
- if (var == 0)
- {
- tempC=(temp - 32) * 5 / 9;
- printf("its %d \n", tempC);
- }
- else
- {
- tempF=temp * 9 / 5 - 32;
- printf("its %d \n", tempF);
- }
- printf("\n");
- return 0;
- }
Add Comment
Please, Sign In to add comment