Answer to Question #255295 in C# for alf

Question #255295

double radius;

double height;

double ans;

Console.WriteLine("what is the radius ");

radius = Convert.ToDouble(Console.ReadLine());

Console.WriteLine("what is the height  ");

height = Convert.ToDouble(Console.ReadLine());   

ans = radius * radius * 3.14 * height ;

Console.WriteLine("your volume is " + ans );

}

}



1
Expert's answer
2021-10-22T16:43:54-0400
using System;
using System.Collections.Generic;


namespace App
{


    class Program
    {


        static void Main(string[] args)
        {
            double radius;
            double height;
            double ans;
            Console.WriteLine("What is the radius: ");
            radius = Convert.ToDouble(Console.ReadLine());
            Console.WriteLine("What is the height:  ");
            height = Convert.ToDouble(Console.ReadLine());
            ans = radius * radius * 3.14 * height;
            Console.WriteLine("Your volume is " + ans);


            Console.ReadLine();
        }




    }
}

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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS