Computer Science, asked by abigail123, 1 year ago

plzzzzzzz answer ....25 points....no fake spam answers​

Attachments:

Answers

Answered by Anonymous
1

/* Write a program to Print

A

AB

ABC

ABCD */

#include<stdio.h>

#include<conio.h>

void main()

{

int x, y, n;

char ch;

printf("\n Enter number of Rows");

scanf("%d",&n);

for(x = 1;x<= n;x++)

{

printf("\n");

ch = 'A';

for(y = 1;y<=x;y++)

{

printf("\t%c",ch);

ch++;

}

}

getch();

}


abigail123: ok can you do it in java didi
abigail123: and using blank space
abigail123: i think u didnt get the question
abigail123: (●´ϖ`●)
Answered by siddhartharao77
3

Sample Program to Print the pattern in Java:

import java.util.*;

class Brainly

{

public static void main(String args[])

{

char i,alphabet,k;

int j;

Scanner demo = new Scanner(System. in);

System.out.print("How many alphabets you want: ");

alphabet = demo.next(). charAt(0);

if(alphabet>=97 && alphabet <= 123)

{

System.out.println("Enter Capital numbers only");

}

else

{

for(i='A';i<=alphabet;i++)

{

for(j = alphabet - i; j > 0; j--)

{

System.out.print(" ");

}

for(k = 'A'; k<=i;k++)

{

System.out.print(k);

}

System.out.println();

}

}

}

}

Output:

(i)

Till how many alphabets you want: F

                A

             AB

          ABC

       ABCD

    ABCDE

  ABCDEF

(ii)

Till how many alphabets you want: b

Enter capital letters only.

Hope it helps!

Attachments:

abigail123: thank you so much
abigail123: please help me with other programs also i am following u
Similar questions