How to make a calculator with c language

How to make a mini  calculator with c language??

Code of c language for as like calculator in this calculator code you can add, substract , multiply and divide only integer .

Code 


include<stdio.h>

int main()
{
    int a;
    int b;
    printf("enter the value of a =\n ",&a);
    scanf("%d",&a);
    printf("enter the value of b=\n");
    scanf("%d", &b);
    printf("result the sum of a and b = %d\n",a + b);
    printf("result the subtract of a and b = %d \n ", a - b);
    printf("result the multiply of a and b = %d \n",a*b);
   
    printf("result the divide of a and b = %d\n",a/b);
   
   
    printf("by ABHINAW singh\n");
    return 0;
}


Note:-------

Here In last section in printf there is my name you can replace with your if you want to change ,then show your name 😄 OK .



Comments

Post a Comment

welcome user , hope you good