Air and water pollution control., HTML programming, GNU Linux.

Tuesday, 17 June 2008

My first C++ code

Yes people I have decide to learn this language for programming. Why decide? I don't know but I found it very interesting. I download some articles and tutorial from internet and after few hours of reading wrote my first code.
This is a program which calculate the surface of the circle - here is the source:

#include < cstdlib >
#include < iostream >
using namespace std;
int main()
const float PI = 3.1415926;
float d=0;
float cir=0;
cout << "Enter the diameter of the disk: ";
cin >>d;
while (d<0)
cout << "Error!\n";
cout <<"Surface is: "<< cir < system("PAUSE");

It is free to redistribute and don't try to cheat it with negative values :)