Write a program performing as calculator which allows all Arithmetic Operators with operands as input

1. Write a C program for performing as calculator which allows all Arithmetic Operators with operands from terminal. Few Input and Output sample are given below:

Recommended: Study Char/Char Array in C/C++           
        
            Sample Input: 1 + 4
            Sample Output: 5

            Sample Input: 8 % 2
            Sample Output: 0

            Sample Input: 6 / 2
            Sample Output: 3

            Sample Input: 5 / 2
            Sample Output: 2.5


Source code in c:

#include<stdio.h>
#include<conio.h>
main()
{
int a,b,z,x,w,h;
char c;
float y,m=0.0;

printf("\nWelcome To My Calculator\n");
AB:
printf("\nenter to calculate (Ex:2+2)\n");
scanf("%d%c%d",&a,&c,&b);
z=(a+b);
x=(a*b);
w=(a-b);
h=(a%b);
y=(a/b);
m=y;
switch(c)
{
case '+' : printf("%d+%d=%d",a,b,z);
break;
case '-' : printf("%d-%d=%d",a,b,w);
break;
case '*' : printf("%d*%d=%d",a,b,x);
break;
case '/' : printf("%d/%d=%2.3f",a,b,m);
break ;
case '%' : printf("%d %d=%d",a,b,h);
break ;
default : printf("error syntax");
break ;
}
goto AB;
getch();
}

Source Code in C++

#include<iostream>
using namespace std;
int main()
{
    int a,b,sum;
    char oper;
    cout<<"Enter an equation to Perform : "<<endl;
    cin>>a;
    cin>>oper;
    cin>>b;
    if(oper=='+')
        sum=a+b;
    else if(oper=='-')
        sum=a-b;
    else if(oper=='*')
        sum=a*b;
    else if(oper=='/')
        sum=a/b;
    cout<<sum;
}

2. Write a C / C++ program for performing all Arithmetic Operation using Arithmetic Operator. The program will take Integer input from terminal as operand.Hints: C= a+b, Here 'a' and 'b' are operand, '=' is assignment operator, and '+' is arithmetic operator.


Source Code in C++

#include<iostream>
using namespace std;
int main()
{
    int b,c,d;
    cin>>b;
    cin>>c;
    d=b+c;
    cout<<d<<endl;
    d=b-c;
    cout<<d<<endl;
    d=b*c;
    cout<<d<<endl;
    d=b/c;
    cout<<d<<endl;
}

101 comments:

  1. #include
    #include
    main()
    {
    int a,b,z,x,w,h;
    char c;
    float y,m=0.0;

    printf("\nWelcome To My Calculator\n");
    AB:
    printf("\nenter to calculate (Ex:2+2)\n");
    scanf("%d%c%d",&a,&c,&b);
    z=(a+b);
    x=(a*b);
    w=(a-b);
    h=(a%b);
    y=(a/b);
    m=y;
    switch(c)
    {
    case '+' : printf("%d+%d=%d",a,b,z);
    break;
    case '-' : printf("%d-%d=%d",a,b,w);
    break;
    case '*' : printf("%d*%d=%d",a,b,x);
    break;
    case '/' : printf("%d/%d=%2.3f",a,b,m);
    break ;
    case '%' : printf("%d %d=%d",a,b,h);
    break ;
    default : printf("error syntax");
    break ;
    }
    goto AB;
    getch();
    }
    By Mahadi.

    ReplyDelete
    Replies
    1. /*Calculator*/
      #include
      #include
      main(){
      printf("calcultor\n");
      float a,b,sum,mul,sub,div,mod;
      char o;
      printf("\nOperator : ");
      scanf("%c",&o);
      printf("Enter value for First Number: ");
      scanf("%f",&a);

      printf("\nEnter value for Second Number: ");
      scanf("%f",&b);
      switch(o){

      case '+':sum=a+b;printf("The sum is : %.2f",sum);break;
      case '-':sub=a-b;printf("The sub is : %.2f",sub);break;
      case '*':mul=a*b;printf("The mul is : %.2f",mul);break;
      case '/':div=a/b;printf("The rat is : %.2f",div);break;
      default:printf("Invalid Operator!!!!");
      }
      }

      Delete
    2. #include

      main()
      {
      int a,b,c;
      char o;
      float a1,b1,c1;
      printf("____Calculator____\n");

      scanf("%d%c%d",&a,&o,&b);

      if(o == '+')
      {
      c = a + b;
      }

      else if(o == '-')
      {
      c = a - b;
      }
      else if(o == '/')
      {
      a1 = a;
      b1 = b;

      c1 = a1 / b1;
      }
      else if(o == '*')
      {
      c = a * b;
      }
      else if(o == '%')
      {
      c = a % b;
      }
      else
      {
      printf("You Are Not Use Arithmetic Oprater.");
      exit(0);
      }


      if(o == '+' || o == '-' || o == '*' || o == '%')
      {
      printf("%d %c %d = %d",a,o,b,c);
      }
      else if(o == '/')
      {
      printf("%.2f %c %.2f = %.2f",a1,c,b1,c1);
      }


      }

      Delete
  2. #include
    #include
    int main()
    {
    int num1,num2;
    float res;
    char opt;
    calc:
    printf("enter your value to calculate\n");
    scanf("%d%c%d",&num1,&opt,&num2);

    switch(opt)
    {
    case '+':res=num1+num2;
    printf("=%f\n",res);
    break;
    case '-':res=num1-num2;
    printf("=%f\n",res);
    break;
    case '*': res=num1*num2;
    printf("=%f\n",res);
    break;
    case '%':res=num1%num2;
    printf("=%f\n",res);
    break;
    case '/':(float)res=(float)num1/(float)num2;
    printf("=%f\n",res);
    break;
    default : printf("error ! enter valid sign\n");
    break;
    }
    goto calc;
    getch();
    return 0;
    }

    ReplyDelete
  3. #include
    main()
    {
    int num1, num2;
    float res;
    char ch;
    cal:
    scanf("%d",&num1);
    scanf("%c",&ch);
    scanf("%d",&num2);
    switch(ch)
    {
    case '+' :res=num1+num2;
    break;
    case '%' :res=num1%num2;
    break;
    case '/' :(float)res=(float)num1/(float)num2; break;
    }
    printf("\n=%.2f",res);
    goto cal;
    getch();
    return 0;
    }


    Here just modify short way.

    ReplyDelete
  4. #include
    main()
    {
    int num1,num2;
    float res;
    char ch;
    scanf("%d %c %d", &num1,&ch,&num2);
    switch(ch)
    {
    case '+' :
    res= num1 +num2;
    break;
    case '%' :
    res= num1%num2;
    break;
    case '/' :
    res= (float)num1/ (float) num2;
    break;
    case '-' :
    res= num1- num2;
    break;
    }
    printf("%2f\n",res);
    getch();
    }

    ReplyDelete
  5. #include
    main()
    {
    int num1,num2,counter=0;
    float res=0;
    float temp1,temp2;

    char ch;
    samira:
    scanf("%d %c %d", &num1,&ch,&num2);
    switch(ch)
    {
    case '+':
    res=num1+num2;
    break;
    case '%':
    res=num1%num2;
    break;
    case '/':
    temp1=num1;
    temp2=num2;
    res=temp1/temp2;
    break;
    case '-':
    res=num1-num2;
    break;
    }
    printf("%2#f\n",res);
    counter++;

    if (counter<=5) goto samira;

    getch();
    }

    ReplyDelete
  6. printf("%2#f\n",res);
    please chk before post here.

    ReplyDelete
  7. #include
    main()
    {
    int num1,num2;
    float res;
    char ch;
    scanf("%d %c %d", &num1,&ch,&num2);
    switch(ch)
    {
    case '+' :
    res= num1 +num2;
    break;
    case '%' :
    res= num1%num2;
    break;
    case '/' :
    res= (float)num1/ (float) num2;
    break;
    case '-' :
    res= num1- num2;
    break;
    }
    printf("%2f\n",res);
    getch();
    }

    ReplyDelete
  8. #include
    #include
    main(){
    int a=44,b=77;
    int sum;
    sum=a+b;
    printf("%d",sum);
    getch();
    }

    ReplyDelete
  9. #include
    #include
    main(){
    int a=55,b=21,substract;
    substract=a-b;
    printf("%d",substract);
    getch();
    }

    ReplyDelete
  10. #include
    #include
    main(){
    int p=16000000,t=20,Multiplication;
    Multiplication=p*t;
    printf("%d",Multiplication);
    getch();
    }

    ReplyDelete
  11. #include
    #include
    main(){
    int z=545,x=5,Division;
    Division=z/x;
    getch();
    }

    ReplyDelete
  12. #include
    #include
    main(){
    int i;
    float x[10],value,total=0.0;
    clrscr();
    for(i=0;i<10;i++)
    scanf("%f",&x[i]);
    x[i]=value;
    for(i=0;i<10;i++)
    {
    total=total+x[i];
    }
    for(i=0;i<10;i++)
    {
    printf("\nx[%2d] =%f",i+1,x[i]);
    }
    printf("\n%f",total);
    getch();
    }

    ReplyDelete
  13. #include
    #include
    main()
    {
    int sum;
    a=6;
    b=9;
    sum=a+b;
    printf("%d, sum");
    getchar();
    }

    ReplyDelete
  14. #include
    main(){
    int i=0,sum=0,array[10],ind;
    while(i<10)
    {
    scanf("%d",&array[i]);
    sum=sum+array[i];
    i=i+1;
    }
    printf("sum=%d\n",sum);
    ind=5;
    printf("array[%d]=%d\n",ind,array[ind]);
    getchar();
    }

    ReplyDelete
  15. #include
    int main()}
    int i=0,sum=0,val;
    while(i<20)
    {
    scanf("%d",&val);
    sum=sum+val;
    i=i+2;
    }
    printf("sum=%d\n",sum);
    return 0;
    }

    ReplyDelete
  16. #include
    main(){
    int cord=4;
    printf("My First Tune\n");
    printf("cord=%d\n",cord);
    return 0;
    }

    ReplyDelete
  17. #include
    #include
    main()
    {
    int i;
    printf("\nEnter Year:");
    scanf("%d",&i);
    if((i%4==0)&&(i%100!=0))
    {
    printf("This Year is leap Year")
    }
    else
    {
    printf("This Year is not leap Year");
    }
    getch();
    }

    ReplyDelete
  18. #include
    #include
    main()
    {
    int Gp1,Gp2,Gp3,Gp4,Gp5;
    float i;
    printf("\n\nEnter 5 subject number:");
    scanf("%d %d %d %d %d",&Gp1,&Gp2,&Gp3,&Gp4,&Gp5);
    i=((Gp1+Gp2+Gp3+Gp4+Gp5)/5);
    printf("\n\n\n\naverage is :%f",i);
    printf("Your GPA=");
    if((i>=80)&&(i<=100))
    printf("A+");
    else if((i>=75)&&(i<=79))
    printf("A");
    else if((i>=70)&&(i<=74))
    printf("A-");
    else if((i>=65)&&(i<=69))
    printf("B+");
    else if((i>=60)&&(i<=64))
    printf("B");
    else if((i>=55)&&(i<=59))
    printf("B-");
    else if((i>=50)&&(i<=54))
    printf("C+");
    else if((i>=45)&&(i<=49))
    printf("C");
    getch();
    }

    ReplyDelete
  19. #include
    #include
    int main()
    {
    int i,sum,arr[10];
    for(i=sum=0; i<10; i++)
    {
    scanf("%d",&arr[i];
    sum6+=arr[i];
    }
    printf("sum=%d\n", sum);
    getch();
    return 0;
    }

    ReplyDelete
  20. #include
    main()
    {
    float divition;
    a=5;
    b=2;
    divition=a/b;
    printf("%f", divition);
    getch();
    }

    ReplyDelete
  21. Write a program from given a series circuit; which has ground floor; 3 resistance & a voltage.

    1.Find out total resistance.
    2.Find out total current flow.
    3.Find out potential difference between two point's.
    4.Find out total power supplied.



    Answer:

    #include
    #include
    main(){
    int r, i, v1, p;
    int r1=2; r2=3, r3=1, v=12;
    r=r1+r2+r3;
    i=v/r;
    v1=i*r1;
    p=v*i;
    printf("Total resistance r=%d\n",r);
    printf("Total current flow i=%d\n",i);
    printf("Potential difference between two point's v1=%d\n",v1);
    printf("Total power supplied p=%d\n",p)
    getch();
    }

    ReplyDelete
  22. #include
    main()
    {
    int s1,s2;
    float i;
    char ch;
    scanf("%d %c %d",&s1,&ch,&s2");
    switch(ch)
    {
    case'+':
    i=(s1+s2);
    printf("%f",i);
    break;
    case'-':
    i=(s1-s2);
    printf("%f",i);
    break;
    case'*':
    i=(s1*s2);
    printf("%f",i);
    break;
    case'/':
    i=(s1/s2);
    printf("%f",i);
    break;
    case'%':
    i=(s1%s2);
    printf("%f",i);
    break;
    }
    getch();
    }

    ReplyDelete
  23. #include
    main()
    {
    int a,b,c;
    float res;
    char sign;
    home:
    printf("\nEnter the funcations: ");
    scanf("%d%c%d",&a,&sign,&b);
    switch(sign)
    {
    case '+':
    res=a+b;
    printf("\nThe result is: %0.2lf\n",res);
    break;
    case '-':
    res=a-b;
    printf("\nThe result is: %0.2lf\n",res);
    break;
    case '/':
    res=a/b;
    printf("\nThe result is: %0.2lf\n",res);
    break;
    case '*':
    res=a*b;
    printf("\nThe result is: %0.2lf\n",res);
    break;
    }
    goto home;
    }

    ReplyDelete
    Replies
    1. Manoshe be carefull about syntax error..Wish ur gud luck.

      Delete
  24. #include
    int main()
    {
    int a,b,sum;
    char oper[2];
    printf("Enter an equation to perform:\n ");
    scanf("%d%s%d",&a,&oper,&b);
    if(oper[0]=='+')
    sum=a+b;
    else if(oper[0]=='-')
    sum=a-b;
    else if(oper[0]=='*')
    sum=a*b;
    else if(oper[0]=='/')
    sum=a/b;
    {
    printf("The result is %d\n",sum);
    }
    }

    ReplyDelete
  25. #include
    #include
    void main()
    {
    int a,b,c,d;
    clrscr();
    printf("Enter the values of a and b:");
    scanf("%d%d" ,&a,&b);
    printf(" Enter your choice between 1 to 5 /n");
    scanf("%d , &d);

    switch(d)
    {
    case 1;
    c=a+b;
    printf(" Addition=%d", c);
    break:
    case 2;
    c=a-b;
    printf(" Substraction=%d" , c);
    break:
    case 3;
    c=a*b;
    printf(" Multiplication=%d", c);
    break:
    case 4;
    c=a/b;
    printf(" Divide=%d", c);
    break:
    case 5;
    c=a%b;
    printf(" Remainder=%d",c );
    break:
    default:
    printf(" Invalid Result");
    break:
    }

    ReplyDelete
  26. Q=Write a C / C++ program for performing all Arithmetic Operation using Arithmetic
    Operator. The program will take Integer input from terminal as operand.

    using the program Source Code in C


    #include
    int main()
    {
    int a,b,c;
    Scanf("%d",&a);
    Scanf("%d",&b);
    c=a+b;
    printf("Enter the value of addition"C);
    c=a-b;
    printf("Enter the value of subrrction"C);
    d=b*c;
    printf("Enter the value of multipolition"C);
    d=b/c;
    printf("Enter the value of piyision"C);
    braek;
    }


    using the program Source Code in C++


    #include
    using namespace std;
    main()
    {
    int x,y,z;
    cin<<x;
    cin<<y;
    z=x+y;
    cout<<"Enter the elemant of addition="<<z<<end;
    z=x-y;
    cout<<"Enter the elemant of subrrction="<<z<<end;
    z=x*y;
    cout<<"Enter the elemant of multipition="<<z<<end;
    z=x/y;
    cout<<"Enter the elemant of piyision="<<z<<end;
    }

    ReplyDelete
  27. Q=Write a C / C++ program for performing all Arithmetic Operation using Arithmetic
    Operator. The program will take Integer input from terminal as operand.

    using the program Source Code in C


    #include
    int main()
    {
    int a,b,c;
    Scanf("%d",&a);
    Scanf("%d",&b);
    c=a+b;
    printf("Enter the value of addition"C);
    c=a-b;
    printf("Enter the value of subrrction"C);
    d=b*c;
    printf("Enter the value of multipolition"C);
    d=b/c;
    printf("Enter the value of piyision"C);
    braek;
    }


    using the program Source Code in C++


    #include
    using namespace std;
    main()
    {
    int x,y,z;
    cin<<x;
    cin<<y;
    z=x+y;
    cout<<"Enter the elemant of addition="<<z<<end;
    z=x-y;
    cout<<"Enter the elemant of subrrction="<<z<<end;
    z=x*y;
    cout<<"Enter the elemant of multipition="<<z<<end;
    z=x/y;
    cout<<"Enter the elemant of piyision="<<z<<end;
    }

    ReplyDelete
  28. Q=Write a C / C++ program for performing all Arithmetic Operation using Arithmetic
    Operator. The program will take Integer input from terminal as operand.

    using the program Source Code in C


    #include
    int main()
    {
    int a,b,c;
    Scanf("%d",&a);
    Scanf("%d",&b);
    c=a+b;
    printf("Enter the value of addition"C);
    c=a-b;
    printf("Enter the value of subrrction"C);
    d=b*c;
    printf("Enter the value of multipolition"C);
    d=b/c;
    printf("Enter the value of piyision"C);
    braek;
    }


    using the program Source Code in C++


    #include
    using namespace std;
    main()
    {
    int x,y,z;
    cin<<x;
    cin<<y;
    z=x+y;
    cout<<"Enter the elemant of addition="<<z<<end;
    z=x-y;
    cout<<"Enter the elemant of subrrction="<<z<<end;
    z=x*y;
    cout<<"Enter the elemant of multipition="<<z<<end;
    z=x/y;
    cout<<"Enter the elemant of piyision="<<z<<end;
    }

    ReplyDelete
  29. Q=Write a C / C++ program for performing all Arithmetic Operation using Arithmetic
    Operator. The program will take Integer input from terminal as operand.

    using the program Source Code in C


    #include
    int main()
    {
    int a,b,c;
    Scanf("%d",&a);
    Scanf("%d",&b);
    c=a+b;
    printf("Enter the value of addition"C);
    c=a-b;
    printf("Enter the value of subrrction"C);
    d=b*c;
    printf("Enter the value of multipolition"C);
    d=b/c;
    printf("Enter the value of piyision"C);
    braek;
    }


    using the program Source Code in C++


    #include
    using namespace std;
    main()
    {
    int x,y,z;
    cin<<x;
    cin<<y;
    z=x+y;
    cout<<"Enter the elemant of addition="<<z<<end;
    z=x-y;
    cout<<"Enter the elemant of subrrction="<<z<<end;
    z=x*y;
    cout<<"Enter the elemant of multipition="<<z<<end;
    z=x/y;
    cout<<"Enter the elemant of piyision="<<z<<end;
    }

    ReplyDelete
  30. Write a C / C++ program for performing all Arithmetic Operation using Arithmetic
    Operator. The program will take Integer input from terminal as operand.

    using the program Source Code in C


    #include
    int main()
    {
    int a,b,c;
    Scanf("%d",&a);
    Scanf("%d",&b);
    c=a+b;
    printf("Enter the value of addition"C);
    c=a-b;
    printf("Enter the value of subrrction"C);
    d=b*c;
    printf("Enter the value of multipolition"C);
    d=b/c;
    printf("Enter the value of piyision"C);
    braek;
    }


    using the program Source Code in C++


    #include
    using namespace std;
    main()
    {
    int x,y,z;
    cin<<x;
    cin<<y;
    z=x+y;
    cout<<"Enter the elemant of addition="<<z<<end;
    z=x-y;
    cout<<"Enter the elemant of subrrction="<<z<<end;
    z=x*y;
    cout<<"Enter the elemant of multipition="<<z<<end;
    z=x/y;
    cout<<"Enter the elemant of piyision="<<z<<end;
    }

    ReplyDelete
  31. #include
    #include

    using namespace std;

    int main()
    {
    int x,y,result;
    string arithmatic;
    cout<<"enter the first number:";
    cin>>x;
    cout<<"enter the second number:";
    cin>>y;
    cout<<"use one of the four artimatic operations /, *, + or - :";
    cin>>arithmatic;
    if (arithmatic=="/" )
    {
    result=x/y;
    cout<<"x / y ="<<result;
    }
    if (arithmatic == "*")
    {
    result=x*y;
    cout<<"x * y ="<<result;
    }
    if (arithmatic == "+")
    {
    result = x + y;
    cout<<"x+y ="<<result;
    }
    if (arithmatic == "-")
    {
    result = x-y;
    cout<<"x-y ="<<result;
    }
    else
    {

    cout<<"what is this? i said use arithmatic operations!";
    }

    return 0;
    }

    ReplyDelete
  32. Ripon
    ID: 734
    Beatch:47
    //WAP using c function to read from a array and do the sum of all elements from that array
    #include
    using namespace std;

    int digit(int n){


    int t;
    while(n!=0)
    {
    t=n%10;
    n=n/10;
    cout<>num;
    digit(num);
    }

    ReplyDelete
  33. RIPON
    ID 734
    Beatch:47
    //WAP to check number which is divisidable by 9 or not.user function to call and return the value
    #include
    using namespace std;
    int divisible(int r);
    int main()

    {
    int n;
    cout<<"intput the divisible number:";
    cin>>n;
    divisible(n);
    }

    int divisible(int r)
    {
    if(r%9==0)
    {

    cout<<"is a divisible 9:";
    }
    else
    {
    cout<<"is not a divisible:";
    }
    }

    ReplyDelete
  34. RIPON
    ID 734
    Beatch:47
    //Evaluate below equation using c function .sum =x+x^2+x^3+.....+x^n
    #include
    using namespace std;
    #include
    int equo(int a,int b);

    int main(){
    int a,b,equation;
    cout<<"Enter the equation:";
    printf("\n\n");
    cin>>a>>b;

    equation=equo(a,b);
    cout<<"result is="<<equation;
    }


    int equo(int g, int h){
    int sum=0;
    int i,j;

    for(i=1; i<=h; i++){
    int mult=1;
    for(j=1; j<=i; j++){

    mult=mult*g;

    }

    sum+=mult;
    }
    return sum;
    }

    ReplyDelete
  35. RIPON
    ID 734
    Beatch:47
    //WAP using function to check whether the given input is divisible by 5 or not
    #include
    using namespace std;
    #include
    int main()

    {
    int n;
    cout<<"Enter you number:"<>n;
    if(n%5==0)
    {
    cout<<"is divisible 5";
    }
    else
    {
    cout<<"is not divisible 5";
    }
    printf("\n");
    }

    ReplyDelete
  36. //*WAP a to find arithmetic operator using constructor*//


    #include
    using namespace std;
    class arithmetic
    {
    public:
    int num1,num2,counter=0;
    float res=0;
    arithmetic();
    ~arithmetic();
    void addition();
    void subtraction();
    void multiply();
    void divide();

    };
    arithmetic::arithmetic()
    {

    cout<<"Enter two integer number :"<>num1>>num2;


    }
    arithmetic::~arithmetic()
    {

    }
    void arithmetic::addition()
    {
    res=num1+num2;
    cout<<"The addition is: ";
    cout<<res<<endl;

    }
    void arithmetic::subtraction()
    {
    res=num1-num2;
    cout<<"The subtraction is: ";
    cout<<res<<endl;
    }
    void arithmetic::multiply()
    {
    res=num1*num2;
    cout<<"the multiplication is: ";
    cout<<res<<endl;
    }
    void arithmetic::divide()
    {
    res=num1/num2;
    cout<<"The division is: ";
    cout<<res<<endl;
    }
    int main()
    {
    arithmetic ob;
    ob.addition();
    ob.subtraction();
    ob.multiply();
    ob.divide();
    }

    ReplyDelete
  37. //Write a program performing as calculator which allows all Arithmetic Operators with operands as input

    #include
    #include
    using namespace std;
    class numchk
    {
    public:
    int num1,num2;
    float res;
    char ch;
    numchk();
    ~numchk();
    void calculation();
    };
    numchk:: numchk()
    {
    cin>>num1;
    cin>>ch>>num2;
    }
    numchk::~ numchk()
    {
    //cout<<"distructor";
    }
    void numchk::calculation()
    {
    switch(ch)
    {
    case '+' :
    res= num1 +num2;
    break;
    case '%' :
    res= num1%num2;
    break;
    case '/' :
    res= (float)num1/ (float) num2;
    break;
    case '-' :
    res= num1- num2;
    break;
    }
    cout<<res;
    getch();
    }

    main()
    {
    numchk nn;
    nn.calculation();
    }



    ReplyDelete
  38. #include
    using namespace std;

    int main(){
    int number_1, number_2;
    float result;
    char op;

    cout<<"Enter operand 1: ";
    cin>>number_1;

    cout<>op;

    cout<>number_2;


    switch(op)
    {
    case '+' : result = number_1+number_2;
    break;

    case '-' : result = number_1-number_2;
    break;

    case '*' : result = number_1*number_2;
    break;

    case '/' : result = number_1/number_2;
    break;

    case '%' : result = number_1%number_2;
    break;
    }

    cout<<endl<<"Result is: "<<result<<endl;
    return 0;
    }

    ReplyDelete
  39. shah syed mohammad fehir Id:201520314
    #include
    using namespace std;
    int main()
    {
    int a,b;
    cin>>a>>b;
    char c;
    cin>>c;
    switch(c)
    {
    case'+':
    cout<<a+b;
    break;
    case'-':
    cout<<a-b;
    break;
    case'*':
    cout<<a*b;
    break;
    case'/':
    cout<<a/b;
    break;
    default:
    cout<<"invalid";
    break;
    }
    }

    ReplyDelete
  40. Appel mahmud akib Id:201510384

    #include
    using namespace std;
    int main()
    {
    int a,b;
    char op;
    cout<<"Input two integer with oparator: ";
    cin>>a>>op>>b;
    switch(op)
    {
    case'+':
    cout<<a+b;
    break;
    case'-':
    cout<<a-b;
    break;
    case'*':
    cout<<a*b;
    break;
    case'/':
    cout<<a/b;
    break;
    defeault:
    cout<<"Invalid input";
    break;
    }
    }

    ReplyDelete
  41. using namespace std;
    int main()
    {
    int c,d;
    #include
    cout<<"Input Investment value: ";
    cin>>c;
    cout<<"input percent of Interest: ";
    cin>>d;
    cout<<c+c*b/100;
    }

    ReplyDelete
  42. #include
    using namespace std;
    int main()
    {
    int a,b;
    cout<<"Input Investment value: ";
    cin>>a;
    cout<<"input percent of Interest: ";
    cin>>b;
    cout<<a+a*b/100;
    }

    ReplyDelete
  43. using c++

    #include

    using namespace std;

    class Calculator
    {
    public:
    float add(float i, float j){
    return i+j;
    }
    float mins(float i, float j){
    return i-j;
    }
    float mult(float i, float j){
    return i*j;
    }
    float devide(float i, float j){
    return i/j;
    }
    float modu(int i, int j){
    return i%j;
    }
    float cal();
    };

    float Calculator::cal()
    {
    Calculator obj;
    string a;
    float x, y;
    cout << "Enter every single value or operator press with ENTER or SPACE ! \n";
    cin >> x >> a >> y;
    if (a == "+"){
    cout << "Total between two number --: " << obj.add(x, y);
    }
    else if (a == "-"){
    cout << "Minus between two number --: " << obj.mins(x, y);
    }
    else if (a == "*"){
    cout << "Multiplication between two number --: " << obj.mult(x, y);
    }
    else if (a == "/"){
    cout << "Devide between two number is --: " << obj.devide(x, y);
    }
    else if (a == "%"){
    cout << "Modulas is --: " << obj.modu(x, y);
    }
    else{
    cout << "You enterd wrong input, try again!";
    }
    }

    int main()
    {

    Calculator obj;
    while (true){
    obj.cal();
    cout << "\n";
    }

    return 0;
    }

    ReplyDelete
  44. using C++
    mamun ID 149
    #include
    using namespace std;
    int main()
    {
    int b,c,result;
    cout<<"Enter Your deserve Number you Want :";
    cin>>b>>c;
    result=b+c;
    cout<<"The total is :"<<result<<endl;
    result=b-c;
    cout<<"The Sub is :"<<result<<endl;
    result=b*c;
    cout<<"The mult is :"<<result<<endl;
    result=b/c;
    cout<<"The divide is :"<<result<<endl;
    return 0;
    }

    ReplyDelete
  45. #include
    using namespace std;


    int main()
    {
    int a,b,sum;

    cout <<"Enter the number of a: "<< endl;
    cin >>a;
    cout <<"Enter the number of b: "<< endl;
    cin >>b;
    sum =a+b;
    cout <<"The adding of sum is: "<<sum<< endl;
    sum =a-b;
    cout <<"The substruct of sum is: "<<sum<< endl;
    sum =a*b;
    cout <<"The multiplication of sum is: "<<sum<< endl;
    sum =a/b;
    cout << "The devide of sum is: "<<sum<< endl;

    return 0;
    }


    id:201510992

    ReplyDelete
  46. #include

    main()

    {
    int a,b,result ;
    printf("Enter a: \n");
    scanf("%d",&a);

    printf("Enter b: \n");
    scanf("%d",&b);

    result = a*a+2*a*b+b*b;
    printf("The result of: %d",result);

    }

    ReplyDelete
  47. #include

    main()

    {
    int a,b,result ;
    printf("Enter a: \n");
    scanf("%d",&a);

    printf("Enter b: \n");
    scanf("%d",&b);

    result = a*a+2*a*b+b*b;
    printf("The result of: %d",result);

    }

    ReplyDelete
  48. #include
    using namespace std;
    int main()
    {
    int a,b;
    char op;
    cout<<"Input two integer with oparator: ";
    cin>>a>>op>>b;
    switch(op)
    {
    case'+':
    cout<<a+b;
    break;
    case'-':
    cout<<a-b;
    break;
    case'*':
    cout<<a*b;
    break;
    case'/':
    cout<<a/b;
    break;
    defeault:
    cout<<"Invalid input";
    break;
    }
    }

    ReplyDelete
  49. #include

    main()

    {
    int a,b,result ;
    printf("Enter a: \n");
    scanf("%d",&a);

    printf("Enter b: \n");
    scanf("%d",&b);

    result = a*a+2*a*b+b*b;
    printf("The result of: %d",result);

    }

    ReplyDelete
  50. #include

    main()

    {
    int a,b,result ;
    printf("Enter a: \n");
    scanf("%d",&a);

    printf("Enter b: \n");
    scanf("%d",&b);

    result = a*a+2*a*b+b*b;
    printf("The result of: %d",result);

    }

    ReplyDelete
  51. #include

    main()

    {
    int a,b,result ;
    printf("Enter a: \n");
    scanf("%d",&a);

    printf("Enter b: \n");
    scanf("%d",&b);

    result = a*a+2*a*b+b*b;
    printf("The result of: %d",result);

    }

    ReplyDelete
  52. Programming is very interesting and creative thing if you do it with love. Your blog code helps a lot to beginners to learn programming from basic to advance level. I really love this blog because I learn a lot from here and this process is still continuing.
    Love from Pro Programmer

    ReplyDelete
  53. Programming is combination of intelligent and creative work. Programmers can do anything with code. The entire Programming tutorials that you mention here on this blog are awesome. Beginners Heap also provides latest tutorials of Programming from beginning to advance level.
    Be with us to learn programming in new and creative way.

    ReplyDelete
  54. //First

    #include
    using namespace std;
    int main()
    {
    int a,b,result;
    char Operator;
    cout<<"Enter your first number : "<>a;
    cout<<"Enter your operator : "<>Operator;
    cout<<"Enter your second number : "<>b;
    if(Operator=='+')
    result=a+b;
    else if(Operator=='-')
    result=a-b;
    else if(Operator=='*')
    result=a*b;
    else if(Operator=='/')
    result=a/b;
    cout<<"Result of your " <<"("<< Operator<<")" << "oparetion is : " <<result<<endl;
    }

    ReplyDelete
  55. //second


    #include
    using namespace std;
    int main()
    {
    int a,b,c;
    cout<<"Enter two numbers : "<>a>>b;
    c=a+b;
    cout<<"Summation of these two number is : " <<c<<endl;
    c=a-b;
    cout<<"Deduct of these twonumber is : " <<c<<endl;
    c=a*b;
    cout<<"Multiplication of these two number is : " <<c<<endl;
    c=a/b;
    cout<<"Division of these two number is : " <<c<<endl;
    }

    ReplyDelete
  56. #include
    int main(){
    int a,b,c,d,p,q;
    printf("enter the fist value=");
    scanf("%d",&a);
    printf("enter the 2nd value=");
    scanf("%d",&b);
    c=a+b;
    printf("%d\n",c);
    d=a-b;
    printf("%d\n",d);
    p=a*b;
    printf("%d\n",p);
    q=a/b;
    printf("%d\n",q);
    }

    ReplyDelete
  57. mausumi sumi#include
    using namespace std;
    int main(){
    int a,b,c;
    cout<<"enter two numbers"<<a<<b;
    c=a+b;
    cout<<"sumation of these two number is"<<c<<endl;
    c=a-b;
    cout<<"substruction of these two number is"<<c<<endl;
    c=a*b;
    cout<<"multipliction of these two number is"<<c<<endl;
    c=a/b;
    cout<<"division of these twp number is"<<c<<endl;
    }

    ReplyDelete
  58. #include

    main()

    {
    int a,b,result ;
    printf("Enter a: \n");
    scanf("%d",&a);

    printf("Enter b: \n");
    scanf("%d",&b);

    result = a*a+2*a*b+b*b;
    printf("The result of: %d",result);

    }

    ReplyDelete
  59. Summer 2017
    ID#201610042

    Answer to the Question No 1:

    problem 1: https://drive.google.com/file/d/0B99eePh0LV8gZlhvU0U4WnEzMnc/view?usp=drivesdk

    problem 2: https://drive.google.com/file/d/0B99eePh0LV8gWHcwamhvOE1YWWc/view?usp=drivesdk

    ReplyDelete
  60. https://drive.google.com/open?id=0Byxq3aat_mNSUDgtczBVc2FpQWM

    ReplyDelete
  61. https://drive.google.com/open?id=0BzKpnVbF4fc3NHhIeE9iMGIxWmc

    ReplyDelete
  62. https://drive.google.com/open?id=0B3bVD5Ppt_STalBiZTc5NVFlTFE

    ReplyDelete
  63. https://www.dropbox.com/s/ur960ibbnyve3q2/calculetar.cpp?dl=0

    ReplyDelete
  64. https://drive.google.com/open?id=0Bw0-FMVCC94QZzR4b2FVbzZ0VzQ

    ReplyDelete
  65. https://drive.google.com/file/d/0B0Llv4Ca9Ln6ZWNld1RwYmhOSlU/view?usp=sharing

    ReplyDelete
  66. https://drive.google.com/file/d/0B0Llv4Ca9Ln6MGhZd2tFM0QtWEE/view?usp=sharing

    ReplyDelete
  67. Asma Rahman
    ID:201610254

    https://drive.google.com/file/d/0BzTqZMBWR6eOVDBkRTBIZThab3c/view

    ReplyDelete
  68. https://drive.google.com/file/d/0BzTqZMBWR6eOVDBkRTBIZThab3c/view

    ReplyDelete
  69. https://www.dropbox.com/s/39de6fy4lmxuapv/cal.cpp?dl=0

    ReplyDelete
  70. correction one;

    https://drive.google.com/file/d/0B0Llv4Ca9Ln6RGh6dnNDQU16LU0/view?usp=sharing

    ReplyDelete
  71. ID : 201620195
    https://drive.google.com/open?id=0B9K31ospCyFjb0xLUkl4VFQ4aUE

    ReplyDelete
  72. https://drive.google.com/open?id=0BzTqZMBWR6eOVDBkRTBIZThab3c

    ReplyDelete
  73. id no:201610259
    name : jahirul islam

    https://drive.google.com/open?id=0B8CpW2ga6ah0NVZBTWVybHFkV1U

    ReplyDelete
  74. ID:201610456
    name:MD USUF MIA
    solution link:
    https://drive.google.com/open?id=0B_PIGnOMR0K2OGNibU5CVGE4WHM

    ReplyDelete
  75. https://drive.google.com/open?id=0B97tDB8iESNCdndtQnE2bFFTbGM

    ReplyDelete
  76. Md Nadim Khandaker
    ID: 201630510
    https://drive.google.com/drive/my-drive

    ReplyDelete
  77. Md Nadim Khandaker
    ID: 201630510
    https://drive.google.com/drive/my-drive

    ReplyDelete
  78. ID:201520552
    https://drive.google.com/open?id=0B5pG0kIjzgEKTlEyVUtibVZPZ2c

    ReplyDelete
  79. ID:201520552
    https://drive.google.com/open?id=0B5pG0kIjzgEKQUdYT0YzWkdhUk0

    ReplyDelete
  80. ID 201610456
    USUF MIA
    https://drive.google.com/open?id=0B_PIGnOMR0K2OGNibU5CVGE4WHM

    ReplyDelete
  81. 1.https://drive.google.com/open?id=0B7UQyRdu6h2wNUpnQmU1R2kyU1U
    2.https://drive.google.com/open?id=0B7UQyRdu6h2wRXlodFExY2xJeWc

    ReplyDelete
  82. Id:201620318
    https://drive.google.com/open?id=0B2gcteJZycWoQzZDWHpHajRsbjA

    ReplyDelete
  83. Id:201620318
    https://drive.google.com/open?id=0B2gcteJZycWoYmJaWF9UZEJwdFE

    ReplyDelete
  84. https://drive.google.com/open?id=0Byxq3aat_mNSb2hEOF83bUxJSjA

    ReplyDelete
  85. Md Nadim Khandaker
    ID: 201630510

    #include
    using namespace std;
    class oper
    {
    public:
    void calculate(int a,int b,char c,float sum)
    {
    if(c=='+')
    sum=a+b;
    else if(c=='-')
    sum=a-b;
    else if(c=='*')
    sum=a*b;
    else if(c=='/')
    sum=(float)a/b;
    else if(c=='%')
    sum=a%b;
    cout<>a>>c>>b;
    oper p;
    p.calculate(a,b,c,sum);
    }

    ReplyDelete
  86. https://drive.google.com/open?id=0BxajN_bZJJw0Z1lrWjVPTUxpNjQ

    ReplyDelete
  87. Id= 201710494
    https://www.dropbox.com/s/yakutye4i9jchv2/prob%201.cpp?dl=0

    ReplyDelete
  88. ID : 201620128

    1. https://drive.google.com/open?id=0B0ZDK2wgeHVWSGYtYWZIZnB3SnM

    2. https://drive.google.com/open?id=0B0ZDK2wgeHVWWUY0NjM5WjlXVnM

    ReplyDelete
  89. https://drive.google.com/open?id=0B3npeIy0YyePQ1hHVHRSM043RWs

    ReplyDelete
  90. https://www.dropbox.com/s/iwjesre8crnztsk/hw.cpp?dl=0

    ReplyDelete
  91. https://www.dropbox.com/s/iwjesre8crnztsk/hw.cpp?dl=0

    ReplyDelete
  92. https://drive.google.com/open?id=0B2Kd5YiufNdVV3hiaWRJY3RoR2c

    ReplyDelete
  93. https://drive.google.com/open?id=0B5eevQy6QwSOOF92WTF2Nm5TekE
    Name: Bithi Paul, ID:201631161

    ReplyDelete
  94. https://drive.google.com/open?id=0B5eevQy6QwSOOF92WTF2Nm5TekE

    Name: Bithi Paul, ID:201631161

    ReplyDelete
  95. ID:-201610058

    1.https://drive.google.com/open?id=0B7UQyRdu6h2wNUpnQmU1R2kyU1U
    2.https://drive.google.com/open?id=0B7UQyRdu6h2wRXlodFExY2xJeWc

    ReplyDelete