Added previous assignments

This commit is contained in:
Shaquille K. Soekhlal
2019-09-12 08:55:54 +02:00
parent fc59dd3913
commit 395564a57a
7 changed files with 175 additions and 0 deletions

18
Assignment 1/main.c Normal file
View File

@ -0,0 +1,18 @@
/*
* 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;
}