A PHP Error was encountered

Severity: 8192

Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated

Filename: libraries/Filtered_db.php

Line Number: 23

Write a C# Sharp program to that takes three numbers(x,y,z) as input and print the output of (x+y).z and x.y + y.z
Q:

Write a C# Sharp program to that takes three numbers(x,y,z) as input and print the output of (x+y).z and x.y + y.z

0

Write a C# Sharp program to that takes three numbers(x,y,z) as input and print the output of (x+y).z and x.y + y.z

Sample Output:

Enter first number - 4                                                                                        
Enter second number - 6                                                                                       
Enter third number - 2                                                                                        
Result of specified numbers 4, 6 and 2, (x+y)·z is 20 and x·y + y·z is 36

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

using System;
public class Exercise10
{
  public static void Main()
  {
    int number1, number2, number3;
 
    Console.Write("Enter first number - ");
    number1 = Convert.ToInt32(Console.ReadLine());
     
    Console.Write("Enter second number - ");
    number2 = Convert.ToInt32(Console.ReadLine());
 
    Console.Write("Enter third number - ");
    number3 = Convert.ToInt32(Console.ReadLine());
 
    Console.Write("Result of specified numbers {0}, {1} and {2}, (x+y)·z is {3} and x·y + y·z is {4}\n\n",
        number1, number2, number3, ((number1+number2)*number3), (number1*number2+number2*number3));
  }
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now