Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3626714
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T23:47:50+00:00 2026-05-18T23:47:50+00:00

In this program I am trying to create a simple calculator. However, I can’t

  • 0

In this program I am trying to create a simple calculator. However, I can’t seem to find a way to overcome the aforementioned error when reaching the Math.Pow line.

namespace BinaryCalc
{
    class Binary
    {
        public static void Main()
        {

        int addition,subtraction;
        float division, multiplication, power, sqrt;

        int x;
        int y;
        x = 10;
        y = 7;

        //Console.WriteLine("Please enter a number for x");
        //string line = Console.ReadLine();
        //int x = int.Parse(line);

        //Console.WriteLine("Please enter a number for y");
        //string line2 = Console.ReadLine();
        //int y = int.Parse(line2);


        addition = (int)x + (int)y;
        subtraction = (int)x - (int)y;
        division = (float)x / (float)y;
        multiplication = (float)x * (float)y;

        power = Math.Pow(x,2);
        sqrt = Math.Sqrt(x);


        Console.WriteLine(" Addition results in {0}", addition);
        Console.WriteLine(" Subtraction results in {0}", subtraction);
        Console.WriteLine(" Division results in {0}", division);
        Console.WriteLine(" Multiplication results in {0}", multiplication);
        Console.WriteLine(" {0} squared results in {0}",x, power);
        Console.WriteLine(" Square root of {0} is: {0}", x, sqrt);

        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T23:47:51+00:00Added an answer on May 18, 2026 at 11:47 pm

    Math.Pow uses a double argument. As the error says, there is no implicit conversion from double to float, so convert the result explicitly to float:

    power = (float)Math.Pow(x, 2);
    

    EDIT
    corrected the conversion order

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a simple game, but I can't find a certain memory
I'm trying to get this simple program to work on windows, but it crashes:
Im trying to use Date Formatters (NSDateFormatter), but I keep getting this error: Program
I'm trying to do this: cmd.exe /C C:\Program Files\Somewhere\SomeProgram.exe > C:\temp\Folder Containing Spaces\SomeProgram.out However,
when I'm trying to compile my c program it gives me this error warning:
I am trying to create a simple translation program for iPhone and have drawn
I'm trying to create a simple program that tells you your lucky number according
I am trying to create a simple MongooseJS example program that gets a list
I'm trying to create a simple visual basic 6 program/database that uses ms access
I'm a complete newbie in OCaml and trying to create a simple console program.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.