okay this is the wrong section and iam pretty sure
1- both sub and function keywords are not defined in c++ they are probably from vb
sub doesnt return a value (aka void) while function does
2- i dont know really, maybe u tell me where u got this 2 words?
3- iostream is a header files contains some functions (and subs before you say it
) which deals with the console input and output like cout and cin etc
4- never heared about it sorry but its another header file ofc
5- yes you may access alot of math functions there like square root , power , trigonometric functions etc
6- int : signed 4 bytes integer, can be positive or negative
7- float: singned 4 bytes number, can have decimal points, can be positive or negative
8-int main():
defines the first controlable code by the programmer, but your program routine here
example (conversation between fahrenheit and celsius):
Code:
#include <iostream> //so we can use the console functions cout and cin
using namespace std; //now u dont need to use std::cout or std::cin
int main()
{
float tempf, tempc; //variables to keep the temperatures.. i picked float because temperaturs can be negative, and can have decimal points ofc
cout << "enter fahrenheit temperature"; //output the message you see
cin >> tempf; //get fahrenheit from user input
//not sure about the converting i have almost forgot everything about last year's physics xD
tempc = (tempf-32)/1.8; //calculate celsius value
cout << "the temperature in celsius equals " << tempc << endl; //output the result and ends the line
return 0;//return to windows
}
you may put in your compiler and press ctrl+f5 yourself