Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
All Arithmetical Operators in C# Console Programing
WhatsApp
Rajan Singh
May 30
2015
1
k
0
0
using
System;
namespace
CSharpFundamentals
{
class
ArithmeticalOperators
{
private
static
void
Main(
string
[] args)
{
double
value1, value2;
Console.Write(
"Enter First Value: "
);
value1 = Convert.ToDouble(Console.ReadLine());
Console.Write(
"Enter Second Value: "
);
value2 = Convert.ToDouble(Console.ReadLine());
Console.WriteLine();
Console.WriteLine(
"Addition: {0} + {1} = {2}"
, value1, value2, value1+value2);
Console.WriteLine(
"Subtraction: {0} - {1} = {2}"
, value1, value2, value1-value2);
Console.WriteLine(
"Multiplication: {0} * {1} = {2}"
, value1, value2, value1*value2);
Console.WriteLine(
"Division: {0} / {1} = {2}"
, value1, value2, value1/value2);
Console.WriteLine(
"Reminder: {0} % {1} = {2}"
, value1, value2, value1%value2);
}
}
}
arithmetical Operation
C#
Up Next
All Arithmetical Operators in C# Console Programing