Makakuha ng eksaktong mga sagot sa iyong mga tanong sa IDNStudy.com. Makakuha ng mga kumpletong sagot sa lahat ng iyong mga tanong mula sa aming network 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
Ang iyong aktibong pakikilahok ay mahalaga sa amin. Magpatuloy sa pagtatanong at pagbahagi ng iyong nalalaman. Sama-sama tayong lumikha ng isang komunidad ng karunungan. Bawat tanong ay may sagot sa IDNStudy.com. Salamat at sa muling pagkikita para sa mas maraming solusyon.