error: expected unqualified-id before '{' token

//
// Conversion - Program to convert temperture from
// Celsius degrees into Fahrenheit:
// Fahrenheit = Celsius * (212 - 32)/100 + 32
//
#include <cstdio>
#include <cstdlib>
#include <iostream>

{
using namespace std;

int, main(int nNumberofArgs, Char* pszArgs[])

//enter the temperature in Celsius
intt celsius;
cout << "Enter the temperature in Celsius:";
cin >> celsius;

// convert Celsius into Frenheit values
int fehrenheit
fehrenheit = celsius * 9/5 + 32;

// output the results (followed by a NewLine)
cout << "Ferhrenheit value is:";
cout << fahrenheit << endl;

// wait until user is ready before terminating program
// to allow the user to see the program results
system("PAUSE");
return 0;
}




error: expected unqualified-id before '{' token
this is in line 10
The { should be moved after the int main row.
Char should be spelled with lower case letters.
intt should be int.
Missing semicolon after int fehrenheit.
You have two different spellings fahrenheit and fehrenheit. Pick one and use it everywhere.
Hi,

there is a couple of mistakes in your code:
1.) You placed "{" before int main,
2.) You placed "," after int in int main.
3.) You don't need that arguments for int main.
4.) You wrote "intt celsius" instead of "int celsius".
5.) You wrote fehrenheit when declaring variable, but when printing it out you named it fahrenheit

Here is fixed code, with numbers of errors in lines where I corrected them:

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
#include <cstdio>
#include <cstdlib>
#include <iostream>


using namespace std;

int main(){ // 1., 2. and 3.


int celsius; // 4.
cout << "Enter the temperature in Celsius:";
cin >> celsius;


int fahrenheit;
fahrenheit = celsius * 9/5 + 32;


cout << "Ferhrenheit value is:";
cout << fahrenheit << endl; // 5.


system ("PAUSE");


return 0;
}


Topic archived. No new replies allowed.