#include <stdio.h>
#include <math.h>
int main()
{
int n = 3;
int i,j,k;
for(i = n; i >= -n; i--)
{
for(j = 0; j < abs(i); j++)
{
printf(" ");
}
for(k = 0; k < n-abs(i); k++)
{
printf("%c ", k + 65);
}
printf("\n");
}
return 0;
}
#include <iostream.h>
#include <math.h>
int main()
{
int n = 3;
for(int i = n; i >= -n; i--)
{
for(int j = 0; j < abs(i); j++)
{
cout<<" "; // 2ws
}
for(int k = 0; k < n-abs(i); k++)
{
cout<<(char)(k + 65)<<" ";
}
cout<<endl;
}
return 0;
}
class PatternProg
{
public static void main(String args[])
{
int n = 3;
for (int i = n; i >= -n; i--)
{
for (int j = 0; j < Math.abs(i); j++)
{
System.out.print(" "); //2ws
}
for (int k = 0; k < n - Math.abs(i); k++)
{
System.out.print((char)(k + 65)+" ");
}
System.out.println();
}
}
}
using System;
class PatternProg
{
public static void Main()
{
int n = 3;
for (int i = n; i >= -n; i--)
{
for (int j = 0; j < Math.Abs(i); j++)
{
Console.Write(" "); //2ws
}
for (int k = 0; k < n - Math.Abs(i); k++)
{
Console.Write((char)(k + 65) + " ");
}
Console.WriteLine();
}
Console.ReadKey(true);
}
}
n = 3
for x in range(n, -(n + 1), -1):
for y in range(0, abs(x)):
print(" ", end="")
for z in range(0, n - abs(x)):
print(chr(z + 65),end="")
print()