To demonstrate basic arithmetic operators - Coder's point

Sunday, June 9, 2019

To demonstrate basic arithmetic operators

 #!/usr/local/bin/perl  
 print "Enter first number : ";  
 $a = <>;  
 print "Enter second Number : ";  
 $b = <>;  
 $add=$a+$b;  
 print ("Addition = $add\n");  
 $sub=$a-$b;  
 print ("subtraction = $sub\n");  
 $mul=$a*$b;  
 print ("Multiplication = $mul\n");  
 $div=$a/$b;  
 print ("division = $div\n");  

 OUTPUT:  
 Enter first number : 15  
 Enter second number : 5  
 Addition=20  
 Subtraction=10  
 Multiplicstion=75  
 Division=3  

No comments:

Post a Comment