aaaaaaaaaaaaaaaaa
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication
{
class Program
{
static void Main(string[] args)
{
int a;
Console.Write("Enter Your Marks: ");
a = Int32.Parse(Console.ReadLine());
if (a > 100 || a < 0) //if given by user marks'a' is greater then 100 and
Console.Write("Invalid Entery!");//less then 0 then print this line
else if (a >= 80) //check this if marks'a' is greater then or equal to 80 then
Console.Write("Grade A "); //print this line
else if (a >= 70) //check this and so on.
Console.Write("Grade B ");
else if (a >= 60)
Console.Write("Grade C ");
else if (a >= 50)
Console.Write("Grade D ");
else //if not in above, means less then 50 then
Console.Write("Fail "); //print this line.
Console.ReadLine();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication
{
class Program
{
static void Main(string[] args)
{
int a, b;
String op;
Console.Write("Enter first number: ");
a = Int32.Parse(Console.ReadLine()); //user enter first integer and assigning to 'a'.
Console.Write("Enter Operator: ");
op = Console.ReadLine(); //user enter operator and assigning to 'op'.
Console.Write("Enter second number: ");
b = Int32.Parse(Console.ReadLine()); //user enter second integer and assigning to 'b'.
if (op == "+") //if 'op' value equal to '+' then
{
Console.Write("Addition: Answer is{0}. ", a + b); //add and print.
}
else if (op == "-") //if 'op' value equal to '-' then
{
Console.Write("Subtraction: Answer is{0}. ", a - b); //subtract and print.
}
else if (op == "/")
{
Console.Write("Division: Answer is{0}. ", a / b);
}
else if (op == "*")
{
Console.Write("Multiplication: Answer is{0}. ", a * b);
}
else //if 'op' value not equal in above then
{
Console.Write("Invalid Entery"); //print this.
}
Console.ReadLine();
}
}
}