Respuesta :
A program that mimics a calculator:
#include <stdio.h>
int main(void)
{
int num1, num2;
char operation;
printf("Please enter two integers and an operator (+, -, *, /): ");
scanf("%d %c %d", &num1, &operation, &num2);
if (operation == '+')
printf("%d + %d = %d\n", num1, num2, num1 + num2);
else if (operation == '-')
printf("%d - %d = %d\n", num1, num2, num1 - num2);
else if (operation == '*')
printf("%d * %d = %d\n", num1, num2, num1 * num2);
else if (operation == '/')
{
if (num2 == 0)
printf("Cannot divide by zero!\n");
else
printf("%d / %d = %d\n", num1, num2, num1 / num2);
}
else
printf("Invalid operator!\n");
return 0;
}
What is program?
A program is a set of instructions that a computer follows to perform a specific task. It is a set of instructions written in a programming language that tells a computer how to perform a specific task. A program can be used to control a computer, create software, and manage data. A program can be written in many different programming languages, such as C, Java, Python, and JavaScript. Programs are used in many different industries to create applications, games, and websites. They are also used to manage data sources and automate tasks. By writing code, developers can create powerful programs that are able to do complex tasks quickly and efficiently.
To learn more about program
https://brainly.com/question/25324400
#SPJ4