PPS Practical 1

PPS Practical 1
  • Aim: Write a program to that performs as calculator (addition, multiplication, division, subtraction).
  • Code:
    //For turboc++ remove below comments
    #include <stdio.h>
    //#include<conio.h>
    void main()
    {
        float i,j,k;
        //clrscr();
        printf("enter two numbers:");
        scanf("%f%f",&i,&j);
        k=i+j;
        printf("Addition = %.2f\n",k);
        k=i-j;
        printf("Substraction = %.2f\n",k);
        k=i*j;
        printf("Multiplication = %.2f\n",k);
        k=i/j;
        printf("Division = %.2f\n",k);
        //getch();
    }
                    
  • Output:
  • Output of practical1

Comments