-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprograms.c
64 lines (45 loc) · 1.1 KB
/
programs.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//printing hello world..
#include <stdio.h>
int main()
{
printf("Hello World");
return 0;
}
//understanding the usage of escape sequence \c
#include <stdio.h>
int main()
{
printf("Hello World\c");
return 0;
}
//converting farenheit to celsius
#include <stdio.h>
int main()
{
float i,celsius,fahrenheit;
celsius=(5.0/9.0)*(fahrenheit-32.0);
for(fahrenheit=0;fahrenheit<=300;fahrenheit=fahrenheit+20)
printf("%3.0f %6.1f\n",fahrenheit,celsius);
return 0;
}
//converting in a tabluar form
#include <stdio.h>
int main()
{
printf("temperature conversion table\n");
float fahrenheit;
for(fahrenheit=0;fahrenheit<=300;fahrenheit=fahrenheit+20)
printf("%3.0f %6.1f\n",fahrenheit,(5.0/9.0)*(fahrenheit-32));
return 0;
}
//celsius to fahrenheit
#include <stdio.h>
int main()
{
printf("temperature conversion table\n");
float celsius,fahrenheit;
fahrenheit=(9.0/5.0)*(celsius+32);
for(fahrenheit=0;fahrenheit<=300;fahrenheit=fahrenheit+20)
printf("%6.1f %3.0f\n",celsius=(5.0/9.0)*(fahrenheit-32),fahrenheit);
return 0;
}