Subtraction of two numbers

 Subtraction of two numbers


C Program

#include <stdio.h>
#include <stdlib.h>
int main()
{
    int a,b,res;
   printf("Enter First Number:");
   scanf("%d",&a);
   printf("Enter Second Number:");
   scanf("%d",&b);
   res = a-b;
   printf("The subtraction of %d and %d is %d",a,b,res);
}


Java Program
import java.util.Scanner;

public class SimpleProgram {

	public static void main(String[] args) 
	{
		Scanner s = new Scanner(System.in);
		System.out.print("Enter First Number:");
		int a = s.nextInt();
		System.out.print("Enter Second Number:");
		int b = s.nextInt();
		System.out.print("Subtraction of " + a +" from " + b + " is " + (a-b));
	}

 }


Python Program
A = int (input("Enter a Number: "))
B = int (input("Enter a Number: "))
print("Subtraction of " + str(A) + " from " + str(B) + " is " + str(A-B) )

0 Comments:

Post a Comment