How to clear screen using c# console application...?like clrscr() in c++..!

Showing Answers 1 - 30 of 30 Answers

Ashok Kumar

  • Dec 18th, 2006
 

Console.Clear() Function

  Was this answer useful?  Yes

Guest

  • Jan 4th, 2007
 

It's in .NET 2.0

  Was this answer useful?  Yes

Prajeesh PM

  • May 17th, 2007
 



consol.clear();

  Was this answer useful?  Yes

Thulasiraman

  • Oct 25th, 2007
 

Is there any other function to clear screen in .Net 1.1

  Was this answer useful?  Yes

baqar

  • Oct 1st, 2011
 

For clear screen in C#/sharp

Code
  1. ClearMyConsole.Clear();

  Was this answer useful?  Yes

sachin

  • Nov 23rd, 2011
 

Yes

Console.Clear() works... its correct.
u can check thru the code i sent

Code
  1. using System;

  2.  

  3. namespace monthlycalculator

  4. {

  5.     class Program

  6.     {

  7.         static void Main(string[] args)

  8.         {

  9.             Console.Clear();

  10.             Console.WriteLine("WELCOME");

  11.            

  12.         }

  13.     }

  Was this answer useful?  Yes

Anuj Malik

  • Oct 5th, 2012
 

Console.Clear();

its work absolute in c#

Code
  1.  

  2. using System;

  3. using System.Collections.Generic;

  4. using System.Linq;

  5. using System.Text;

  6.  

  7. namespace ConsoleApplication9

  8. {

  9.     class student

  10.     {

  11.         string name = "";

  12.         int phy;

  13.         int chem;

  14.         int math;

  15.         int eng;

  16.         int hindi;

  17.         int min_marks;

  18.         int per;

  19.         int max_marks=500;

  20.         void total()

  21.         {

  22.  

  23.             min_marks = phy + chem + math + eng + hindi;

  24.  

  25.         }

  26.  

  27.         void persent()

  28.         {

  29.  

  30.             per = (min_marks*100)/max_marks;

  31.         }

  32.  

  33.        

  34.        void set()

  35.         {

  36.             Console.WriteLine("enter student name -: ");

  37.             name = Console.ReadLine();

  38.             Console.WriteLine("enter the marks of physics :- ");

  39.             phy = Convert.ToInt16(Console.ReadLine());

  40.             Console.WriteLine("enter the marks of chemistry :- ");

  41.             chem = Convert.ToInt16(Console.ReadLine());

  42.             Console.WriteLine("enter the marks of maths :- ");

  43.             math = Convert.ToInt16(Console.ReadLine());

  44.             Console.WriteLine("enter the marks of english :- ");

  45.             eng = Convert.ToInt16(Console.ReadLine());

  46.             Console.WriteLine("enter the marks of hindi :- ");

  47.             hindi = Convert.ToInt16(Console.ReadLine());

  48.            

  49.         }

  50.         void display()

  51.         {

  52.             Console.Clear();

  53.             Console.WriteLine("

  54.                 student name is -:       " +name);

  55.             Console.WriteLine("         total of all marks is -: " + min_marks);

  56.             Console.WriteLine("         percentage  is -:        " + per);

  57.  

  58.  

  59.         }

  60.            

  61.      

  62.  

  63.         static void Main(string[]args)

  64.         {

  65.             student s1 = new student();

  66.             s1.set();

  67.             s1.total();

  68.             s1.persent();

  69.             s1.display();

  70.             Console.ReadLine();

  71.         }

  72.     }

  73. }

  74.  

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions