Simple sum console app Codes for C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int a = 100;
int b = 30;
int c = a + b;
int d = a – b;
int e = a * b;
int f = a / b;

Console.WriteLine(a);
Console.WriteLine(b);
Console.WriteLine(c);
Console.WriteLine(d);
Console.WriteLine(e);
Console.WriteLine(f);

Console.ReadLine();
Console.ReadLine();
Console.ReadLine();
Console.ReadLine();
Console.ReadLine();

This code should be typed in program.cs

Method 2

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int a = 100,b = 30, c = a + b, d = a – b, e = a * b ,f = a / b;

Console.WriteLine(a);
Console.WriteLine(b);
Console.WriteLine(c);
Console.WriteLine(d);
Console.WriteLine(e);
Console.WriteLine(f);

//the code below is to provide space for the answers returned when you run the console //

Console.ReadLine();
Console.ReadLine();
Console.ReadLine();
Console.ReadLine();
Console.ReadLine();

}
}
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s