LeventHAN icon

Untitled

LeventHAN | PRO | 10/05/19 06:13:21 PM UTC | 0 ⭐ | 290 👁️ | Never ⏰ | []
C |

980 B

|

None

|

0 👍

/

0 👎

/*
    Huh this fucked me up... :( 
*/
 
 
#include <stdio.h>
 
int main(void)
{
    getal1 = getw;
    operand = 
    getal2 =
    
    char a;
    printf("Enter an expression (without spaces!): \n");
    scanf("%f%c%f%*c",&getal1,&operand,&getal2);
    printf("%f%c%f%*c",&getal1,&operand,&getal2);
    
    switch (operator) 
    {
        case '+':
            cout << getal1 << " + " << getal2 << " = " << getal1+getal2;
            break;
        case '-':
            cout << getal1 << " - " << getal2 << " = " << getal1-getal2;
            break;
        case '*':
            cout << getal1 << " * " << getal2 << " = " << getal1*getal2;
            break;
        case '/':
            cout << getal1 << " / " << getal2 << " = " << getal1/getal2;
            break;
        default:
            // operator is doesn't match any case constant (+, -, *, /)
            cout << "Error! operator is not correct";
            break;
    }
    
    
    
    return 0;
}

Comments