Digital-Systems-Assignments/Assignment 1/main.c

18 lines
471 B
C
Raw Normal View History

2019-09-12 06:55:54 +00:00
/*
* Student: S.K Soekhlal
* Number: 4860632
* Assignment: 1.3
*/
#include<stdio.h>
#include<stdlib.h>
int main(){
double c,k=0,f=0; /*Declaring variables*/
scanf("%lf",&c); /*Storing an inputted value in variable C(for celsius)*/
k = c + 273.15; /*Calculating temperature in Kelvin*/
f = (c*1.8)+32; /*Calculating temperature in Fahrenheit*/
printf("C\tK\tF\n");
printf("%.2f\t%.2f\t%.2f\n",c,k,f); /*printing values*/
return 0;
}