C Programming Tutorial – 12 – Math Operators

Facebook – https://www.facebook.com/TheNewBoston-464114846956315/
GitHub – https://github.com/buckyroberts
Google+ – https://plus.google.com/+BuckyRoberts
LinkedIn – https://www.linkedin.com/in/buckyroberts
reddit – https://www.reddit.com/r/thenewboston/
Support – https://www.patreon.com/thenewboston
thenewboston – https://thenewboston.com/
Twitter – https://twitter.com/bucky_roberts

Comments

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 !!

The Other Youtuber says:

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!

Muhammad Nouman says:

Cannot see anything .

Dev Sharma says:

Why we use float?

muhammad waleed says:

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 add;
    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);

    if(function = add){
        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

Adibiwikitiki AA 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

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);
    
    printf(“Please enter current year: n”);
    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?
{

float farad;

   
printf(“What is the uf rating of your capacitor?n”);
scanf(“%f”,farad);

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);
printf(“Enter your birthyear:”);
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??!!

Write a comment

*

Human Verification: In order to verify that you are a human and not a spam bot, please enter the answer into the following box below based on the instructions contained in the graphic.


Do you like our videos?
Do you want to see more like that?

Please click below to support us on Facebook!

Send this to a friend

▷ Other ReviewsVehicles▷ Show Cars▷ Motorbikes▷ Scooters▷ Bicycles▷ Rims & Tires▷ Luxury BoatsFashion▷ Sunglasses▷ Luxury Watches▷ Luxury Purses▷ Jeans Wear▷ High Heels▷ Kinis Swimwear▷ Perfumes▷ Jewellery▷ Cosmetics▷ Shaving Helpers▷ Fashion HatsFooding▷ Chef Club▷ Fooding Helpers▷ Coktails & LiquorsSports▷ Sport Shoes▷ Fitness & Detox▷ Golf Gear▷ Racquets▷ Hiking & Trek Gear▷ Diving Equipment▷ Ski Gear▷ Snowboards▷ Surf Boards▷ Rollers & SkatesEntertainment▷ DIY Guides▷ Zik Instruments▷ Published Books▷ Music Albums▷ Cine Movies▷ Trading Helpers▷ Make Money▷ Fishing Equipment▷ Paintball Supplies▷ Trading Card Games▷ Telescopes▷ Knives▷ VapesHigh Tech▷ Flat Screens▷ Tech Devices▷ Camera Lenses▷ Audio HiFi▷ Printers▷ USB Devices▷ PC Hardware▷ Network Gear▷ Cloud Servers▷ Software Helpers▷ Programmer Helpers▷ Mobile Apps▷ Hearing AidsHome▷ Home Furniture▷ Home Appliances▷ Tools Workshop▷ Beddings▷ Floor Layings▷ Barbecues▷ Aquarium Gear▷ Safe Boxes▷ Office Supplies▷ Security Locks▷ Cleaning ProductsKids▷ Baby Strollers▷ Child Car Seats▷ Remote ControlledTravel▷ Luggages & Bags▷ Airlines Seats▷ Hotel Rooms▷ Fun Trips▷ Cruise Ships▷ Mexico Tours