language: C++ 4.7.2 (gcc-4.7.2)
date: 203 days 13 hours ago
link:
visibility: public
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
#include <iostream>
using namespace std;
const int num = 6;
 
float convert (float temps [ ], int num);
int main()
{
int i;
float Fahrenheit[] = {-40.0, 0, 32.0, 98.6, 100.0, 212.0};
float Celcius[6];
 
Celcius = convert(Fahrenheit, num);
 
for (i = 0; i < num; ++i)
{cout << Celcius[i];}
system("pause");
return 0;
}
 
float convert (float tempz[], int i)
{
float celcius[6];
for( i = 0; i < 6; ++i)
{celcius[i] = ( tempz[i] - 32) * (5/9);}
 
return celcius[6];
}
 
prog.cpp: In function ‘int main()’:
prog.cpp:12: error: incompatible types in assignment of ‘float’ to ‘float [6]’
prog.cpp:16: error: ‘system’ was not declared in this scope