Friday, August 16, 2019

WAP for addition,subtraction,multiplication and division of two numbers.

// C program to add,subtract,multiply and divide.

#include<stdio.h>
int main()
{
    int a,b;
    printf("Enter two numbers:");
    scanf("%d",&a);
    scanf("%d",&b);
    printf("Addition=%d",a+b);
    printf("\nSubtraction=%d",a-b);
    printf("\nMultiplication=%d",a*b);
    printf("\nDivision=%d",a/b);
    return 0;
}

Sample Input/Output:

Enter two numbers:20
20
Addition=40
Subtraction=0
Multiplication=400
Division=1

No comments:

Post a Comment

Write a program to find gcd of two numbers using recursion.

About:  The process in which a function calls itself is called recursion and the corresponding function is called as recursive function. ...