/switchCalculator

Simple Switch Calculator

Primary LanguageC

README: Switch Calculator

Description

Switch Calculator is a simple command-line calculator application written in C. It supports basic arithmetic operations such as addition, subtraction, multiplication, and division.

Table of Contents

Features

  • Supports four basic arithmetic operations:
    • Addition (+)
    • Subtraction (-)
    • Multiplication (*)
    • Division (/)
  • Takes user input for the operator and two operands
  • Displays the result with a precision of one decimal place

Usage

  1. Compile the switchcalculator.c file using a C compiler (e.g., GCC):

    gcc switchcalculator.c -o switchcalculator
    
  2. Run the compiled executable:

    ./switchcalculator
    
  3. Follow the prompts to enter the operator and operands:

    Enter operator ( +, -, /, * ): +
    Enter two operands: 3.5 2.5
    
  4. The result will be displayed:

    3.5 + 2.5 = 6.0