.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> C# >> Post New Question Subscribe to Interview Questions

How can we find out odd and even numbers?

Posted By :Ramesh P     Posted Date :October 19, 2010    Points :10   Category :C# 
int input=50;

input=input%2;
if(input ==1)
{
response.write("this number is odd number");
}
else
{
response.write("this number is even number");
}

You can also find related Interview Question to How can we find out odd and even numbers?  below: 

How can we find the open transactions details in sql server?

  
Yes, it is possible.

select * from sysprocesses where open_tran > 0


This query will provide list of all the open transaction details. (More...)

How to Find Number of Days for provided date range?

  
Code extract :

TimeSpan DayDifference = Convert.ToDateTime("2009-1-7").Subtract(Convert.ToDateTime("2009-1-1"));


To find the difference of the days, here we have used Subtract method. The Subtract method does not take start date into consideration. Hence, to get the exact number of days for the date range we need to add one more day to the result.

Response.Write("Number of Days : " + DayDifference.Days+1); (More...)

How to find data with generics list in VB.NET (Write code).

  
In the code example below, the function "FindData" will return list("sublist") of the objects having matchingKey same as viewstate value.
Dim sublist As List(Of MyClass)
sublist = allClient.FindAll(AddressOf FindData) 'sublist will contain objects matching specified matching condition

Function FindData(ByVal b As MyClass) _
As Boolean
If (b.matchingKey = CInt(ViewState("matchingKey "))) Then 'matching condition
Return True
Else
Return False
End If
End Function (More...)

How can you find IP address of the client in ASP.net ?

  
string clientIPAddress = Request.UserHostAddress.ToString(); (More...)

How can you find ComputerName of the client in ASP.net ?

  
string ComputerName = WindowsIdentity.GetCurrent().Name.ToString(); (More...)

How can you find DateTime in ASP.net?

  
DateTime now = System.DateTime.Now; (More...)

How can you find CurrentDate in ASP.net?

  
string c_date = DateTime.Today.ToString("dd/MM/yyyy"); (More...)

How can you find CurrentTime in ASP.net?

  
string c_time = DateTime.Now.ToShortTimeString(); (More...)

How can you find UserDomainName in ASP.net?

  
string site = Environment.UserDomainName; (More...)

I can't seem to find System.Windows.Forms.Integration, where do I find it?

  
The System.Windows.Forms.Integration namespace is defined in WindowsFormsIntegration.dll which currently ships in the WinFX SDK, not in the standard redist. Therefore, the file will be found in "\Program Files\Reference Assemblies\ Microsoft\Avalon\v2.0.50215?. (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend