DEV Community

Technical Vandar
Technical Vandar

Posted on

3 1

C Program For Working Calculator.

Here Is The Complete C Programming Code For Working Calculator.

#include<stdio.h>
int main()
{
    int a, b;
    char op;
    float result;
    printf("Enter First Number:");
    scanf("%d", &a);
    printf("Enter Second Number:");
    scanf("%d", &b);
    printf("Enter Operater What Do You Want:");
    scanf(" %c", &op);
    switch (op)
    {
    case '+':
        result=a+b;
        printf("The Sum Is %f", result);
        break;
    case '-':
        result=a-b;
        printf("The Subtract Is %f", result);
        break;
    case '*':
        result=a*b;
        printf("The Multiply Is %f", result);
        break;
    case '/':
        result=a/b;
        printf("The Division Is %f", result);
        break;
        default:
    printf("Please Enter Envalid Operater");
        break;
    }
}
Enter fullscreen mode Exit fullscreen mode

Top comments (1)

Collapse
 
aouadj_haroun99 profile image
عواج هارون

💯

Some comments may only be visible to logged-in visitors. Sign in to view all comments.

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more