This is a very basic question. In int main() why is it a int and not a void and why do you have to return 0.
#include <iostream> // The # represens a preprocessor directive and <iostream is a header file>
int main()
{
//std stands for standard
std::cout << "You are a secret agent breaking into a secure server room...";
std::cout << std::endl; //endl means end line
std::cout << "You need to enter the correct codes to continue...";
const int a = 4;
const int b = 3;
const int c = 2;
const int sum = a + b + c;
const int product = a * b * c;
std::cout << std::endl;
std::cout << sum << std::endl;
std::cout << product << std::endl;
return 0;
//use std::cout << std::endl for new line
}
Don't mind the comments. I am taking a udemy class and it says you have to return 0. Why did they say that. Thanks for the help.