Trouble finding errors

This is some code from c++ for dummies that i can't run because of the errors i find when i build it

These are the errors

C:\Users\GORGE\Desktop\C++\Coverter\main.cpp: In function 'int main(int, char**)':
C:\Users\GORGE\Desktop\C++\Coverter\main.cpp:22: error: expected ';' before 'int'
C:\Users\GORGE\Desktop\C++\Coverter\main.cpp:23: error: 'fahrenheit' was not declared in this scope
C:\Users\GORGE\Desktop\C++\Coverter\main.cpp:32: error: expected ';' before 'return'
Process terminated with status 1 (0 minutes, 0 seconds)



#include <cstudio>

#include <iostream>
#include <cstdlib>
using namespace std;

int main(int nNumberofArgs, char* pszArgs[])
{
    // enter the tempeture in celsius
    int celsius;
    cout << "Enter The Tempeture In Celsius:";
    cin >> celsius;

    //calculate conversion factor for celsius
    // to fahrenheit
    int factor;
    factor = 212-32

    //use conversion factor to covert celsius
    // into fahrenheit values
    int fahrenheit;
    fahrenheit = factor * celsius/100 + 32;

    // output the results (followed by a newline)
    cout << "Fahrenheit 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;
If you use the <> button instead of the other one, it'll format your code better :)

You're just missing a semicolon. And there's a typo on one of the includes.

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
#include <cstudio> // should be <cstdio>
#include <iostream>
#include <cstdlib>
using namespace std;

int main(int nNumberofArgs, char* pszArgs[])
{
    // enter the tempeture in celsius
    int celsius;
    cout << "Enter The Tempeture In Celsius:";
    cin >> celsius;

    //calculate conversion factor for celsius
    // to fahrenheit
    int factor;
    factor = 212-32 // <--- missing semicolon here

    //use conversion factor to covert celsius
    // into fahrenheit values
    int fahrenheit;
    fahrenheit = factor * celsius/100 + 32;

    // output the results (followed by a newline)
    cout << "Fahrenheit 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;
}
wow thanks its all fixed now. im just new to c++ sooo yea.

thanks so much :)
Topic archived. No new replies allowed.