0% found this document useful (0 votes)
25 views

Data Types Program

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Data Types Program

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

using System;

class DataTypesProgram
{
static void Main()
{

int Qty;
double Total_Price, Price_Per_Piece;

Console.Write("Enter the pieces of apple: ");


Qty = Convert.ToInt32(Console.ReadLine());

Console.Write("Enter the total price of apple: ");


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

Price_Per_Piece = Total_Price / Qty;

Console.WriteLine("\nThe total price of apple is: " + Total_Price);


Console.WriteLine("The value of the original price per piece is: " +
Price_Per_Piece);
Console.WriteLine("The value of converted price is: " +
Math.Round(Price_Per_Piece));

Console.WriteLine("\nPress any key to exit...");


Console.ReadKey();
}
}

You might also like