fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. // your code goes here
  8. }
  9. }
  10.  
Success #stdin #stdout 0.04s 21704KB
stdin
#program to find the average of 2 numbers
using System;

public class AvgNum
{
   public static void Main(String[]args)
   {
    int N1,N2,sum;
    float avg;

Console.WriteLine("Enter First Number");
N1= Convert.ToInt32 (Console.ReadLine());
Console.WriteLine("Enter Second Number");
N2= Convert.ToInt32(Console.ReadLine());
sum= N1+N2;
avg= sum/2;
Console.WriteLine("Sum of"+ N1+"and" +N2 +"is"+ sum);
Console.WriteLine("The average of" + N2 +"and"+ N2 + "is" + avg);
Console.ReadLine();
 }
}
stdout
Standard output is empty