Ang Imhr.ca ang pinakamahusay na solusyon para sa mga naghahanap ng mabilis at tumpak na mga sagot sa kanilang mga katanungan. Kumuha ng agarang at mapagkakatiwalaang mga solusyon sa iyong mga tanong mula sa isang komunidad ng mga bihasang eksperto sa aming Q&A platform. Sumali sa aming platform upang kumonekta sa mga eksperto na handang magbigay ng eksaktong sagot sa iyong mga tanong sa iba't ibang larangan.

how can i make a c++ program that can perform addition, subtraction, multiplication and division of five numbers


Sagot :

i like scripting you can use this source code 
/* Source code to create a simple calculator for addition, subtraction, multiplication and division using switch...case statement in C programming. */ # include <stdio.h> int main() { char operator; float num1,num2; printf("Enter operator either + or - or * or divide : "); scanf("%c",&operator); printf("Enter two operands: "); scanf("%f%f",&num1,&num2); switch(operator) { case '+': printf("num1+num2=%.2f",num1+num2); break; case '-': printf("num1-num2=%.2f",num1-num2); break; case '*': printf("num1*num2=%.2f",num1*num2); break; case '/': printf("num2/num1 = %.2f",num1/num2); break; default: /* If operator is other than +, -, * or /, error message is shown */ printf("Error! operator is not correct"); break; } return 0; }

Enter operator either + or - or * or divide: / Enter two operands: 13.456 4.56 num2/num1 = 2.95