1. Welcome to PHCorner Forums. Take a moment to Sign up and gain unlimited access and extra privileges that guests are not entitled to, such as:

    All that and more! Registration is quick, simple and absolutely free. Join our community today!

C and C++ Patulong po!!

Discussion in 'Coding, Programming' started by ™jamon111996™, Sep 26, 2014.

  1. mga ka ph dyan na magagaling sa c language program paturo naman po ng code>
    for educational purposes lang po ito mga bossing..

    bale ganito po yung output ng program:

    1.additional
    2.subtraction
    3.multiplication
    4.division

    select:

    >>>

    tapos pagpinindot po yung
    nasa selection above po

    automatic po random ang
    mga digit po and then mag aask po ng
    posible result yung program,

    if mali po yung eneter mo na result program say's "Wrong"
    kung tama naman po "CORRECT"

    thanks po sa tulong mga IDOL!!
     
  2. Lawliet_1

    Lawliet_1 Support Team Staff Member Support Team

    meron yata ako nito wait halungkatin ko kung nakasave pa :p
    tol may code ka na ba na nagawa? pasilip kung meron na
     
  3. napagdaanan ko na yan nuon..easy lang yan tol....basa ka na lang sa book...nanjan lang yan
     
  4. meron boss, pero hanggang sa main choices lang ako,, hindi ko na alam kasuno eh
     
  5. #include<stdio.h>
    #include<conio.h>
    main()
    {
    clrscr();
    float a,b,sum,sub,mul,div;
    char operation;
    printf("Enter first number:");
    scanf("%f",&a);
    printf("Enter second number:");
    scanf("%f",&b);
    printf("\nMENU\n");
    printf("a. Addition\n");
    printf("s. Subtraction\n");
    printf("m. Multiplication\n");
    printf("d. Division\n");
    printf("Press the correct letter to the corresponding operation:");
    do
    {
    operation=getchar();
    }
    while(operation!='a' && operation!='s' && operation!='m' && operation!='d');
    switch(operation)
    {
    case 'a':
    {
    sum=a+b;
    printf("The answer is:%.2f",sum);
    break;
    }
    case 's':
    {
    sub=a-b;
    printf("The answer is:%.2f",sub);
    break;
    }
    case 'm':
    {
    mul=a*b;
    printf("The answer is:%.2f",mul);
    }
    break;
    case 'd':
    {
    div=a/b;
    printf("The answer is:%.2f",div);
    }
    break;
    default:
    {
    printf("Error! operator is not correct");
    break;
    }
    }
    getch();
    return 0;
    }

    sana nakatulong
     
  6. astigg1

    astigg1 Addict Established

    try sana makatulong


    Code:

       Sorry you need to Register / Login to see this Codes!    

     
  7. astigg1

    astigg1 Addict Established

    C++ ba yan o turbo C?
     
Tags / Keywords: