Advertisement
Fhernd

Calculadora.cs

Nov 13th, 2017
344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.56 KB | None | 0 0
  1. using System;
  2.  
  3. public class Calculadora
  4. {
  5.     public static void Main (string[] args)
  6.     {
  7.         int a = Convert.ToInt32( args[0] );
  8.         int b = Convert.ToInt32( args[1] );
  9.        
  10.         // Realiza operaciones aritméticas básicas
  11.         Console.WriteLine ("La adición de {0} y {1} es {2}.", a, b, (a+b));
  12.         Console.WriteLine ("La sustracción de {0} y {1} es {2}.", a, b, (a-b));
  13.         Console.WriteLine ("El producto de {0} y {1} es {2}.", a, b, (a*b));
  14.         Console.WriteLine ("El cociente de {0} y {1} es {2}.", a, b, (a/b));
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement