[ad_1]
Facebook –
GitHub –
Google+ –
LinkedIn –
reddit –
Support –
thenewboston –
Twitter –
C++ Tutorial – 6 – Beginning Functions
by
Tags:
Comments
41 responses to “C++ Tutorial – 6 – Beginning Functions”

u can also replace the math function with # include<math.h>

Which is the software u r using

Why in the world are did you do "using namespace std" within main???

it uses double because its twice as precise as float

Can we become a gud hacker on games after all learning all ur tuts?

Include C Meth Library. Done.
About the name "double" – used to be synonym for long float. Long float was removed in C89 standard. (to be more specific, single precision and double precision originated in Fortran) 
9 + 11 = 20… 9/11

is it true king kong was the best programmer?

Visual studio is so much faster and better.

@Obretin use this "The square root of " . a . "is" . b;

when i hit run, it tells me the square root of the number but with no spaces…it says: the square root of121is11…i wanted to be:the square root of 121 is 11
any help? 
I feel like I should be paying you tuition for watching these videos.

you dont have to do the whole thing with num2, you can just say sqrt(num1) when you need the square root.

So basically, what 'double' does is that it adds decimals? So using 'int' will just round it to the nearest whole?

thanks i understand now!

The square root of a number is the number you start with when you square them. Example: 9² = 9 * 9 = 81. Here, the square root of 81 is 9. If you don't know the exact meaning of squaring/cubing, when you square a number, you multiply that number by itself once. Cubing is exactly the same, but you multiply it by itself twice (9 * 9 * 9). The ² or ³ is the amount of times you multiply a number by itself.

im 10 i like programming in notepad c++ and java. but.. what is a square root of something?

friendly advice: selflearn programming at your own pace
however, teachers can help you with questions and other problems 
————

Damn, thanks to pascal this shit is easier to comprehend so far. :O

Double is not really double precision as it has more than double precision of a float. It has double the space in the RAM. On a 32bit system, float uses 32bit (1 bit for the sign, 8 bits for the exponent, 23 bits for the significant) and double uses 64bit (1 bit for the sign, 11 bits for the exponent, 52 bits for the significant). Double uses twice as much space as a float.

Nice video dude. Great job explaining so far, and I'm getting it all. I now like experimenting in C++ and FreeBasic. I started with Yabasic and moved to Freebasic from there. Very fun. Keep up the nice tutorials.

Yes. Hold your horses. I'm sure Bucky will get to this in some of the later tutorials.

im new to this i was wondering if anyone knows the answer to my question, is it not possible to make another function beside the main, and have that funcion after main but somehow be called in by main i think im confusing my self,
int main()
{
call to 1function
}
1 function()
{
{ 
std::cout <<"Nice video!" << std::endl;

Me too 😀

better than any teacher ive had at morgan state university smh

nice ,u can google

just press F9

lmao i just downloaded the new AVG and it doesn't let me debug it since it find viruses…
wtf 
the 'double' data type is also similar to the 'float' data type, although as @HappyFoxIsHappy has pointed out, the 'double' data type is used because it is more precise than one floating point

int is only full integers, double will take decimals and multiply them, add them, etc.

Because num 2 is the sqrt of num1 right… and the sqrt of num1 is going you a value with decimals..
"int" can only take numbers that dont have decimals (eg 5).. "double" can take numbers with decimals (eg 5.85) 
These tuts are GREAT! Omg I love this.

i wanna know why too!

why can't I use
int num1;
instead of
double num1
??? 
actually a Float variable is the standard real number, a double is a real number with twice the amount of maximum decimal points.

How do you create functions, not use them?

Can you make a list of variables and what they are?

hey man i got a problem…when i execute it , it normaly says "pick ur number" when i choose a number and press enter it shows "the square root of……." and closes really fast. beacuse system("pause") didn't work for me i have cin.get();

watch the first part
Leave a Reply