Practical - 1 - WAP to take two integers from user and print their addition, subtraction, multiplication and division.

Practical - 1


Aim: Write a program  to take two integers from user and print their addition, subtraction, multiplication and division.

 

Program:

#include<stdio.h>

#include<conio.h>

 

void main()

{

    clrscr();

    int a,b;

 

    printf("Enter The First Number = ");

    scanf("%d",&a);

    printf("Enter The Second Number = ");

    scanf("%d",&b);

 

    printf("\nAddition = %d", a + b);

    printf("\nSubtraction = %d", a - b)

    printf("\nMultiplication = %d", a * b);

    printf("\nDivision = %d", a / b);

   

    getch();

}

 

 

Output:

 

Enter The First Number = 6

Enter The Second Number = 5

 

Addition = 11

Subtraction = 1

Multiplication = 30

Division = 1

 

 

Algorithm:

Step-1: START

Step-2: Declare a and b.

Step-3: Enter the value of a and b.

Step-4: Display a + b.

Step-5: Display a – b.

Step-6: Display a * b.

Step-7: Display a / b.

Step-8: STOP.

 

Flowchart:



Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.