#include
int main() //makes the main section of code
{ //starts everything in main
float pi = 3.14159; //makes a variable that holds 5 decimal places, name = pi, value = 3.14159
float pi2; //makes another decimal variable which will then hold pi times 2
pi2 = pi*2; //multiplies pi times 2
std::cout << pi2 <<"\n"; //std::cout tells it to print, pi2 shows pi2, \n makes new paragraph
system("PAUSE"); //waits for you to close the box
return 0; //just a thing needed to finish the program
} //ends the section called main.
you must always have a ; after each line except when using {} and int main() and #include
For feedback I would just like to know how well you understand this now that it is broken down a bit. It was written in C++ coding.
No comments:
Post a Comment