Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C# (http://www.go4expert.com/forums/c-sharp/)
-   -   Input the subject and find total numberof marks and percentage (http://www.go4expert.com/forums/input-subject-total-numberof-marks-t25857/)

Patel 22May2011 09:42

Input the subject and find total numberof marks and percentage
 
Code:

using System;
using System.Collections.Generic;
using System.Text;

namespace division
{
    class Program
    {
        static void Main(string[] args)
        {
          Double hindi, eng, math, total, per;
            Console.WriteLine("Enter the marks of hindi");
            hindi = Double.Parse(Console.ReadLine());
            Console.WriteLine("Enter the marks of eng");
            eng = Double.Parse(Console.ReadLine());
            Console.WriteLine("Enter the marks of math");
            math = Double.Parse(Console.ReadLine());
            total=hindi+math+eng;
            per=total/3;
            Console.WriteLine("hindi  {0}",hindi);
            Console.WriteLine("math  {0}", math);
            Console.WriteLine("eng  {0}", eng);
            Console.WriteLine("total  {0}", total);
            Console.WriteLine("percentage  {0}",per);
            if (per >= 60)
            {
                Console.WriteLine("First");
            }
            else if (per >= 50)
            {
                Console.WriteLine("Second");
            }
            else
            {
                Console.WriteLine("Fail");
            }
            Console.ReadLine();
        }
    }
}

<Amit Patel>


All times are GMT +5.5. The time now is 22:34.