Help please

Posts 1–9 of 9 · Page 1 of 1
Help please
Program is in Dutch so if you want it to be English just say it.
Code:
#include <iostream>
using namespace std;

int main()
{
    // declaratie en initialisatie van pi end declaratie van straal:
    double pi = 3.14159265358979;

    cout << "Geef de straal van een cirkel in meters" << end1;
    cout << "en ik bereken de omtrek" << end1;
    cin >> straal;
    cin.get();                                //eind invoer

    cout << "De omtrek is: ";

    //declaratie en initialisate van omtrek:
    double omtrek = 2 * pi * straal;
    cout << omtrek << " meter";
}
So this are my errors:
C:\Users\***\Pictures\gta mods\emulators\C++\project 12.4\main.cpp||In function 'int main()':|
C:\Users\***\Pictures\gta mods\emulators\C++\project 12.4\main.cpp|9|error: 'end1' was not declared in this scope|
C:\Users\***\Pictures\gta mods\emulators\C++\project 12.4\main.cpp|11|error: 'straal' was not declared in this scope|
||=== Build finished: 2 errors, 0 warnings (0 minutes, 0 seconds) ==
int main()
{
// declaratie en initialisatie van pi end declaratie van straal:
double pi = 3.14159265358979;
double straal = 0;
cout << "Geef de straal van een cirkel in meters\n";
cout << "en ik bereken de omtrek" << endl; // E N D L
cin >> straal;
cin.get(); //eind invoer

cout << "De omtrek is: ";

//declaratie en initialisate van omtrek:
double omtrek = 2 * straal * pi;
cout << omtrek << " meter";
}
. ?
Quote Originally Posted by abuckau907 View Post
. ?
what dot? ...
also change

cout << "en ik bereken de omtrek" << end1;
to

cout << "en ik bereken de omtrek" << endl;
Quote Originally Posted by namek303 View Post
also change



to
thanks that is one error gone but still I got the error at

cin >> straal;
I tried code blocks and dev C++ and both give error I even tried to change straal to pizza but doesn't work please help me.
Like abuckau907 said you need to initialize the value like this

// declaratie en initialisatie van pi end declaratie van straal:
double pi = 3.14159265358979;
double straal = 0;
Quote Originally Posted by namek303 View Post
Like abuckau907 said you need to initialize the value like this
thanks bro, I had some few errors after but fixed them myself REP+ for ya
cin >> straal;

You did not declare it buddy.
So why are you trying to use it. It's one of the basic you learn while learning C++.
You must declare a variable before you can use it.
Posts 1–9 of 9 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us