Pattern-11

 Pattern11


C Program
#include <stdio.h>
#include <stdlib.h>
int main()
{
    int numbers,i,j;
    char c='A';
    printf("Enter the Number of rows:");
    scanf("%d",&numbers);
    for(i =0 ; i <numbers; i++)
     {
       for(j=0; j <numbers ; j++)
       {
        printf("%c ",c);

       }
        printf("\n");
         c++;
     }
}



Java Program
import java.util.Scanner;

public class Pattern_11 {

	public static void main(String[] args) {
		Scanner S = new Scanner(System.in);
		System.out.print("Enter Number of Rows:");
		int n = S.nextInt();
		char c = 'A';
		for(int i=0; i<n;i++)
		{
			for(int j=0;j<n;j++)
			{
				System.out.print(c + " ");
				
			}
			System.out.print("\n");
			c++;
		}
	}

}


Python Program
n = int(input("Enter numbe of rows: "))
a=65
for i in range(n):
    for j in range(n):
        print(chr(a), end=" ")
    a=a+1
    print(" ")

0 Comments:

Post a Comment