• +91 9723535972
  • info@interviewmaterial.com

CSharp Interview Questions and Answers

Question - C# program to remove an element from the queue.

Answer -

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Application
{
 class DemoProgram
 {
  static void Main(string[] args)
  {
   Queue qs = new Queue();
   qs.Enqueue(1);
   qs.Enqueue(2);
   qs.Enqueue(3);
   foreach (Object ob in qs)
   {
    Console.WriteLine(ob);
   }
    Console.WriteLine(); Console.WriteLine();
    Console.WriteLine("Total number of elements in the Queue " + qs.Count);
    Console.WriteLine("Does the Queue contain " + qs.Contains(3));
    Console.ReadKey();
   }
 }
}

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners