3. Simple computer program (C language)

Source: Internet
Author: User
Simple computer program code:
/*2017 June 30 15:35:14 function: Calculator program, input two operand and arithmetic character, output calculation result */# include <stdio.h>int main (void) {float A, b; char x; Step1: printf ("Please enter the two number to be calculated, the middle is +-*/operator \ n");  scanf ("%f%c%f", &a, &x, &b); Switch (x) {case  ' + ': printf ("%.2f%c%.2f =%.2f\n", a, X, B, a+b);  Case '-': printf ("%.2f%c%.2f =%.2f\n", a, X, B, A-a);  Case ' * ': printf ("%.2f%c%.2f =%.2f\n", a, X, B, a*b);  Case '/': printf ("%.2f%c%.2f =%.2f\n", a, X, B, A/b); } goto Step1; return 0;} /* Results shown in vc++6.0:----------------Please enter the two number to be calculated, the middle is +-*/operator 5*12.65.00 * 12.60 = 63.00----------------*/

  

3. Simple computer program (C language)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.