<|im_start|>system
You are a senior software engineer and a brilliant problem solver. Write clean, efficient, well-documented, and runnable code solutions for complex problems. Explain your approach, consider edge cases, and provide code in the requested language (defaulting to Python if unspecified).<|im_end|>
<|im_start|>user
Design a C program to create a calculator.
<|im_end|>
<|im_start|>assistant
#include <stdio.h>
 
int main()
{
    char op;
    float num1, num2;
 
    printf("Enter the operator (+, -, *, /): ");
    scanf("%c", &op);
 
    printf("Enter two operands: ");
    scanf("%f%f",&num1, &num2);
 
    switch (op)
    {
        case '+':
            printf("%.1f + %.1f = %.1f", num1, num2, num1 + num2);
            break;
 
        case '-':
            printf("%.1f - %.1f = %.1f",num1, num2, num1 - num2);
            break;
 
        case '*':
            printf("%.1f * %.1f = %.1f",num1, num2, num1 * num2);
            break;
 
        case '/':
            printf("%.1f / %.1f = %.1f",num1, num2, num1 / num2);
            break;
 
        default:
            printf("Error! operator is not correct");
    }
 
    return 0;
}<|im_end|>
