TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Yaron Shemesh
NA
2
556
What do I need to change in this program?
Jan 15 2018 3:41 PM
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApp3
{
class Program
{
static void Main(string[] args)
{
int num1 = 0, num2 = 0;
char c = 'a';
//double result = 0;
Console.WriteLine("Please enter 2 numbers:");
num1 = int.Parse(Console.ReadLine());
num2 = int.Parse(Console.ReadLine());
Console.WriteLine("Please enter the operation sign:");
c = char.Parse(Console.ReadLine()); /
Calc (num1,num2,c); //
}
public static void Calc (int a, int b, char c) //
{
double result = 0;
int num1 = 0; int num2 = 0;
char sign ='a';
switch (sign)
{
case '+':
result = num1 + num2; break;
case '-':
result = num1 - num2; break;
case '*':
result = num1 * num2; break;
case '/':
result = num1 / num2; break;
}
if (result != 0)
Console.Write(result);
else
Console.Write("This is wrong");
Console.ReadKey();
}
}
}
Reply
Answers (
1
)
filter out nullable UserID LINQ
Crystal Report Logon Failed Problem