60 429
Assignments Done
Successfully Done
In April 2018

Answer to Question #32695 in C# for priyanka rule

Question #32695
Kathy, a software developer in FIT technologies, is assigned the task of optimizing the following
using System;
public class SwapNumber
void SwapNum(ref int a, ref int b)
int temp;
temp = a;
a = b;
b = temp;
static void Main(string[] args)
SwapNumber classobj = new SwapNumber();
int Number1, Number2;
Console.WriteLine("Enter the first number");
Number1 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Enter the second number");
Number2 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("The value of first number is {0}",
Console.WriteLine("The value of second number is {0}",
classobj.SwapNum(ref Number1,ref Number2);
Console.WriteLine("Now the value of first number after
swaping is {0}", Number1);
Console.WriteLine("Now the value of second number after
swapping is {0}", Number2);
Optimize the preceding code for Kathy and find out the errors (if any). What would be the output of
the preceding code, if the first number is 46 while the second number is 37?
Expert's answer

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions