tubeshowcase●1,165,017 videos♡ My collection 0
← Learn to Code

Learn to Code07:48

Let's code a calculator with C programming! 🖩

Bro Code ↗

From the creator

#coding #programming #cprogramming // CALCULATOR PROGRAM char operator = '\0'; double num1 = 0.0; double num2 = 0.0; double result = 0.0; printf("Enter the first number: "); scanf("%lf", &num1); printf("Enter the operator (+ - * /): "); scanf(" %c", &operator); // clear \n from input buffer printf("Enter the second number: "); scanf("%lf", &num2); switch(operator){ case '+': result = num1 + num2; break; case '-': result = num1 - num2; break; case '*': result = num1 * num2; break; case '/': if(num2 == 0){ printf("You can't divide by zero!\n"); } else{ result = num1 / num2; } break; default: printf("Invalid operator\n"); } printf("result: %.4lf", result); return 0;

Published 2025-03-09 · Watch on YouTube ↗
Availability and playback restrictions are controlled by the original channel.

Keep exploring Learn to Code