
Write a program create a calculator with operators using C Language || C programming
C is a general-purpose, procedural computer programming language supporting structured programming, lexical variable scope, and recursion, with a static type system. By design, C provides constructs that map efficiently to typical machine instructions.
This program takes an arithmetic operator +, -, *, / and two operands from the user. Then, it performs the calculation on the two operands depending upon the operator entered by the user.
The * operator entered by the user is stored in operator. And, the two operands, 1.5 and 4.5 are stored in first and second respectively.
This statement calculates the product and displays it on the screen.
To make our output look cleaner, we have simply limited the output to one decimal place using the code %.1lf.
Finally, the break; statement ends the switch statement.
#CProgrmmingLanguage
#Calculator