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
What is part of a method signature in c#?
What is a singleton unity?
What's the difference between class and object?
Where is the keyword void used?
What are properties in C#?
Why dataset is used in c#?
Is hashset serializable c#?
Explain the accessibility modifier protected internal?
What is data quality assurance?
How does dll hell solve in .net?
Can arraylist hold primitive types?
Enlist the different types of classes in c#?
What are the collections in c#?
Enlist all the components of an ado.net framework?
Are c# destructors the same as c++ destructors?