-
Notifications
You must be signed in to change notification settings - Fork 17
/
hw10.c
96 lines (40 loc) · 1.13 KB
/
hw10.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#include <stdio.h>
#include <stdlib.h>
main()
{
int celsius, fahrenheit = 0, condition = 0, temperture = 0;
while (condition != -1)
{
printf("\nEnter temp in celsius:");
scanf_s("%i", &celsius);
fahrenheit = (celsius * 1.8) + 32;
printf("\n temp in fahrenheit :%i ", fahrenheit);
printf("\nEnter temp in fahrenheit:");
scanf_s("%i", &fahrenheit);
celsius = (fahrenheit - 32) / 1.8;
printf("\n temp in celsius :%i ", celsius);
printf("\ncontinue -1 to exit", &condition);
scanf_s("%i", &condition);
}
system("pause");
}
/*
//examples and examples of prototypes.
int multi(int a);
void cube(int a);
main(void) {
int var;
var = multi(4); //16
printf("%i\n", var);
printf("%i\n", multi(9));
}
void cube(int a) {//function definitions.
int result;
result = a*a*a;
printf("%i", result);
}
int multi(int a) {//example of another functions
int result;
result = a * a;
return result;
}*/