0% found this document useful (0 votes)
5 views2 pages

Program Q's

Uploaded by

rupams2024
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Program Q's

Uploaded by

rupams2024
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Q:- Accept 2 numbers say n1 and n2.

Display all prime numbers between na and n2.

Console.WriteLine("Enter the productId of the Selected Product Name to check


available stock ");

Console.WriteLine("================================================================
==========");
int productid = Convert.ToInt32(Console.ReadLine());
int availableStock = 0;
switch(purc)
{
case 101:
availableStock = purchase.PurchaseQuantity
break;
case 102:
break;
case 103:
break;
default:
break;
}

==========================================================================
List<Product> listProduct = new List<Product>()
{
new Product{ProductId=101,ProductName="Megatop Black Pens"},
new Product{ProductId=102,ProductName="Sketches green"},
new Product{ProductId=103,ProductName="Erasers"}
};

List<Sales> listSales = new List<Sales>()


{
new Sales{ProductId=101,SalesQuantity=25},
new Sales{ProductId=102,SalesQuantity=5},
new Sales{ProductId=103,SalesQuantity=10}
};
List<Purchase> listPurchase = new List<Purchase>()
{
new Purchase{ProductId=101,PurchaseQuantity=100},
new Purchase{ProductId=102,PurchaseQuantity=25},
new Purchase{ProductId=103,PurchaseQuantity=20}
};

Console.WriteLine("Enter the Id of the Selected Product Name to check


available stock ");

Console.WriteLine("================================================================
==========");
Console.WriteLine("Id\t\t Product Name");
Console.WriteLine("101\t\tMegatop Black Pens");
Console.WriteLine("102\t\tSketches green");
Console.WriteLine("103\t\tErasers");
int productid = Convert.ToInt32(Console.ReadLine());
int availableStock = 0;
if(.ProductId == productid && purchase.ProductId==productid)
{
availableStock = purchase.PurchaseQuantity - sales.SalesQuantity;
Console.WriteLine($"Stock Quantity is :{availableStock}");
}

You might also like