how can i get this 123456789
1234 6789
123 789
12 89
1 9
Answer / tanvir anwar
int n = 9; // you can use any odd number for similar pattern
int mid = (n+1)/2;
for (int i = 0; i < mid; i++)
{
for (int j = 1; j <= n; j++)
{
if (j <= mid-i || j >= mid+i)
Console.Write({0}, j);
else
Console.Write(" ");
}
Console.WriteLine();
}
Is This Answer Correct ? | 10 Yes | 2 No |
What is application c#?
What is event delegate in c#?
What is the difference between asp net and c#?
What is web forms in c#?
public void A() { int x; x = 8; x *= 4 + 8 / 2; } Given the above code, what is the value of "x"?
How Is The Dll Hell Problem Solved In .net?
Is c# a backend language?
How do I create a multilanguage?
What is difference between C# and VB.NET?
What is local function?
What is the Signification of the "new " keyword in C#? example
write program in C# for palindrome? (aug 2009) write program in C3 for generating below output?(aug 2009) # # # # # # # # # #