Can you declare an array of mixed Types?
Answer / kris
public struct FormStruct
{
public string Name ;
public string Address;
public int Phone;
}
class Program
{
static void Main(string[] args)
{
FormStruct home;
home.Name = "xyz";
home.Address= "blabla";
home.Phone= 9955511122;
}
}
| Is This Answer Correct ? | 5 Yes | 17 No |
Code for Working with Files under a Directory?
c# code to Count number of 1's in a given range of integer (0 to n)
Create a class called Accounts which has data members like ACCOUNT no, Customer name, Account type, Transaction type (d/w), amount, balance D->Deposit W->Withdrawal If transaction type is deposit call the credit(int amount) and update balance in this method. If transaction type is withdraw call debit(int amt) and update balance. Pass the other information like Account no,name,Account Type through constructor. Call the show data method to display the values.
program for string reverse(eg:- i am boy -> boy am i)
8 Answers Black Pepper, Infosys, Mind Tree,
how to change password in .net with c # with ado.net and also SQL server 2008 change password
How to add a value from textBox over an existing certain column in SQL Server
IS Array list is generic or non generic
Can you declare an array of mixed Types?
Write a function which accepts list of nouns as input parameter and return the same list in the plural form. Conditions: i) if last letter is r then append s ii) if word ends with y then replace it by ies iii) call this function in main() and produce the required output. for eg:- if chair is input it should give chairs as output.
Hello Sir, Thanks for the Solution but, can you pls. Explain the coding for the Static Function & static variable from the below coding....waiting for Ans. class fact { public static void Main() { fact f=new fact(); int x=1; //Declaration of x as 1 int k=Convert.ToInt32(Console.ReadLine()); for(int i=1;i<=k;i++) { x= x *i; } System.Console.WriteLine(x); } }
Automatically Hyperlink URLs and E-Mail Addresses in ASP.NET Pages with C#
Code for Reading and writing from a file in c#?