Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Assignment # 1 Print the pattern given below using single
printf statement

XX XX
XX XX
XX XX
X X
X X
XX XX
XX XX
XX XX


Assignment # 2 Print the pattern given below using single
printf statement
(please do NOT use the string function below)
0
909
89098
7890987
678909876
56789098765
4567890987654
345678909876543
23456789098765432
1234567890987654321

Answer Posted / tanvi

Assignment 1:
namespace PrintExcercise
{
class Program
{
static void Main(string[] args)
{
string xx;

for (int i = 0; i < 8; i++)
{
xx = "XX XX";
if (i == 3 || i == 4)
{
xx = xx.Remove(xx.Length - 1, 1);
xx = xx.Remove(0, 1);
}

Console.WriteLine(xx);
}

}
}
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the extension methods in c#?

912


What is difference between method and function in c#?

914


HOW to Develope the CRUD(create,read,update,delete) FORM IN WINDOWS form by using c# only

951


Structs are not reference types. Can structs have constructors?

976


Explain the difference between the system.array.copyto() and system.array.clone()?

931


Is unity object oriented?

926


What is the difference between int16 and int32 in c#?

940


What is a class in unity?

909


What is private readonly in c#?

951


What is list collection in c#?

961


What are the different types of comments in c#?

882


Write a short note on interface?

996


How do I convert a string to an int in c#?

983


What is a static field?

899


what is inheritance and an example in vb.net and c# of when you might use it?

952