IDNStudy.com, ang iyong mapagkakatiwalaang mapagkukunan para sa maaasahang mga sagot. Magtanong at makatanggap ng maaasahang sagot mula sa aming dedikadong komunidad ng mga eksperto.

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