Monday, November 28, 2022

 



Hey there assassins, welcome to cyber assassins a couple days ago our admin Lyc posted the same code

but i have fixed some bugs. so here is the code:


#include <stdio.h>


int main()

{

    char operation;

    double a, b;

    printf("Enter the first number\n");

    scanf("%lf", &a);

    printf("Enter the operation you want to do. It must be * / + - x ÷\n");

    scanf(" %c", &operation);

    printf("Enter the second number\n");

    scanf("%lf", &b);


switch (operation)

{

case '+':

    printf("%0.1lf+%0.1lf=%0.1lf\n", a, b, a+b);

    break;

case '*':

    printf("%0.1lfx%0.1lf=%0.1lf\n", a, b, a*b);

    break;

case '-':

    printf("%0.1lf-%0.1lf=%0.1lf\n", a, b, a-b);

    break;

case '/':

    printf("%0.1lf÷%0.1lf=%0.1lf\n", a, b, a/b);

    break;

case 'x':

    printf("%0.1lfx%0.1lf=%0.1lf\n", a, b, a*b);

    break;

case '÷':

    printf("%0.1lf÷%0.1lf=%0.1lf\n", a, b, a/b);

    break;


default:

    printf("Please enter a valid oparator such as * / + - x ÷\n");

}

    return 0;

}

0 comments:

Post a Comment

Contact Us

Phone :

+8801716815647
+8801996204467
+8801520731186

Email :

susmoy1025@gmail.com
dishantanjim@gmail.com
sadmansakib7494@gmail.com