## C Programming Tutorial – 12 – Math Operators

GitHub – https://github.com/buckyroberts
reddit – https://www.reddit.com/r/thenewboston/
Support – https://www.patreon.com/thenewboston
thenewboston – https://thenewboston.com/

shandis wong says:

He is hilarious (Y)

GamerComedy says:

thank you for your all tutorials…………… your just making c programming more easier for me….. keep it up… i’m gonna see your next ones too

M D J says:

how do we calculate exponentials? what’s the syntax for that operator? like 4 to the power of 5?

Thossen Kent says:

Idk if anyone can tell me what I’m doing wrong here or what but I’m copying character by character the same code that bucky is typing her ein this video, but my /n functions do not work, so that the console will display /n instead of telling the console to go to a new line.

james brown says:

26/11/2014 time 02:16 p.m, i’m at bucky tutorial lesson 12

Captain Jack Sparrow says:

Bucky’s back! Cheers !!

Quick question…. for a float, do you have to write the number with a decimal or could it have been just a whole number and the computer makes it a decimal answer? Thanks!

NoSafeSpaces says:

595 lbs?? 12 lb watermelons?? Are you living on Jupiter?

Honus Wagner says:

Hey Buzky!,I’m Sorry it was supposed to be Bucky. Now I know the formula for dating. I don’t even know bagels,I’ve search the net and found out that their just like donuts…. Hey Sir!,Thank You for the Nice Tutorial. I really like your Humor when you do your videos. kudos! I’m Starting to learn how to Code now… Thank You!

Cannot see anything .

Dev Sharma says:

Why we use float?

Its only me, or everyone here needs zoom in tool button? to watch it out

Jeffrey Chen says:

Hey guys, I’ve made a function/calculator, but it’s not really working

#include
#include

int main(void)
{
int num1;
int num2;
int function;
int sum;
int difference;
int product;
int quotient;
int subtract;
int multiply;
int divide;

printf(“Enter 2 numbers:”);
scanf(“%d%d”, &num1, &num2);
printf(“Now choose amongn addn subtractn multiplyn dividenEnter here:”);
scanf(“%s”, &function);

sum = num1 + num2;
printf(“%d plus %d equals %d”, num1, num2, sum);
}
else if (function = subtract){
difference = num1 – num2;
printf(“The difference is %d”, difference);
}
else if (function = multiply){
product = num1 * num2;
printf(“%d times %d equals %d”, num1, num2, product);
}
else if (function = divide){
quotient = num1 / num2;
printf(“&d divide by %d equals %d”, num1, num2, quotient);
}
else{
printf(“What the fk are you doing”);
}
getch();
}

When I run this it i can only do add and when i try to subtract it goes really wrong. just wondering can anyone help me on that?

Fia Kreuz says:

thx u so much ^^ you explain these stuff better than my IT proffesors

Joe Drizzle says:

are you really 595 pounds

Turncoat says:

You should make the text size smaller

thank you for your all tutorials…………… your just making c programming more easier for me….. keep it up… i’m gonna see your next ones too

emmanuel nunez says:

Im trying to run this code below and it runs fine until it gets ready to run  printf(“You are %d years old n”, currentAge); and then get this as the following line that is running (lldb). I’m running this code in Xcode compiler.

{
int currentAge, birthYear, currentYear;

printf(“Please enter you birth year: n”);
scanf(“%d”, &birthYear);

scanf(“%d”, &currentYear);

currentAge = currentYear – birthYear;

printf(“You are %d years old n”, currentAge);

return 0;
}

Casper says:

I want to make a calculator for a capacitor but it freezes when I enter the uf rating, it doesn’t freeze when I use integer, but I need realy precise numbers. Did I do something wrong?
{

printf(“What is the uf rating of your capacitor?n”);

dom my says:

how can i calculate 10^n (exponent)?

TheKarolans says:

Now we know how to override laws of math. Cat knows how to override laws of nature. Sounds fair lol.

Mike M says:

Pay attention when dividing integers, example: 11/4=2 in C. Remainder is dumped to stay within the integer set. Unfortunately it doesn’t round up nicely to 3.

MunifTheGreat says:

So until now what I learned from Bucky is that he is 28 years old and is married to 21 year old Rachel Mcadams and weighs 595 lbs and has 53 babies and writes loads of craps everyday.

Ayush Mishra says:

i still dun understand the purpose of % operator

Veljko Vujovic says:

For what do we use float???? I cant find it in video

Controversy Owl says:

I’ve started learning C and C++, wtf? C++ is much more intuitive.

Attanox T says:

What did I do wrong?

#include
#include

int main()
{

int currentYear;
int birthYear;

printf(“Enter current year:”);
scanf(” %d”, &currentYear);
scanf(” %d”, &birthYear);
printf(“You are %d years old.”, currentyear – birthYear);

return 0;
}

Shreyash Gupta says:

Hang on……595 POUNDS!!!!!! Isn’t that supposed to be nearly 300 kgs??!!