C# simple using simple if else statement
using System;
namespace blog
{
public class student_entry
{
public char information;
public void get_info()
{
Console.WriteLine("*************Uniform and Id_card is important IF you want TO attend the class***************");
Console.WriteLine("ENTER | Y | if you have both && | n | if dont have");
information = Convert.ToChar(Console.ReadLine());
if(information == 'Y')
{
Console.WriteLine("you are able to attend the class");
}
else
{
Console.WriteLine("sorry you are not able to attent the class");
}
}
static void Main(string[] args)
{
student_entry obj=new student_entry();
obj.get_info();
Console.ReadKey();
}
}
}
namespace blog
{
public class student_entry
{
public char information;
public void get_info()
{
Console.WriteLine("*************Uniform and Id_card is important IF you want TO attend the class***************");
Console.WriteLine("ENTER | Y | if you have both && | n | if dont have");
information = Convert.ToChar(Console.ReadLine());
if(information == 'Y')
{
Console.WriteLine("you are able to attend the class");
}
else
{
Console.WriteLine("sorry you are not able to attent the class");
}
}
static void Main(string[] args)
{
student_entry obj=new student_entry();
obj.get_info();
Console.ReadKey();
}
}
}
OUTPUT