1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Levart [38]
3 years ago
15

Write a program that gets a single character from the user. If the character is not a capital letter (between 'A' and 'Z'), then

the program does nothing. Otherwise, the program will print a triangle of characters that looks like this:
Computers and Technology
1 answer:
Sholpan [36]3 years ago
4 0

This question is incomplete. The complete question is given below:

Write a program that gets a single character from the user. If the character is not a capital letter (between 'A' and 'Z'), then the program does nothing. Otherwise, the program will print a triangle of characters that looks like this:

  A

 ABA

ABCBA

ABCDCBA

Answer:

#include <stdio.h>

void printTri(char asciiCharacter){

   // Row printer

//   for(int i = 65; i <= ((int)asciiCharacter); i++){

   int i = 65;

   while(i <= ((int)asciiCharacter)){

       int leftMargin = ((int)asciiCharacter) - i; +

       int j = 1;

       while(j <= leftMargin){

           printf(" ");

           j++;

       }

       int k = 65;

       while(k < ((int)i)){

           printf("%c",(char)k);

           k++;

       }

       int l = ((int)i);

       while(l >= 65){

           printf("%c",(char)l);

           l--;

       }

       printf("\n");

       i++;

   }

}

int main()

{

   for(;;){

       printf("Please enter a character between A and Z. Enter (!) to exit \n");

       char in;

//       scanf("%c",&in);

       in = getchar();

       getchar();

       printf("Printing Triangle for: %c \n",in);

       if(((int)in) >= 65 && ((int)in) <= 90){

           printTri(in);

           printf("\n");

       }else if(((int)in) == 33){

           break;

       } else {

           continue;

       }

   }

   return 0;

}

Explanation:

  • Inside the printTri function, print spaces, characters in order as well as characters in reverse order.
  • Inside the main function, take the character as an input from user then print the triangle by validating first to ensure that the character lies between a to z alphabets.
You might be interested in
UC is trying to switch from legacy CRM to salesforce and wants to keep legacy CRM and salesforce in place till all the functiona
nikklg [1K]

Answer: suggesting MDM solution and also linking MDM to both the salesforce and sap. More so, integrating SAP with both Salesforce and legacy CRM.

NB: Don't ever integrate legacy CRM to Salesforce

Explanation:

It should be noted that the best recommendation that could be given in order to keep data in synch b/w Salesforce, legacy CRM and SAP is by suggesting MDM solution and also linking MDM to both the salesforce and sap. More so, integrating SAP with both Salesforce and legacy CRM.

NB: Don't ever integrate legacy CRM to Salesforce

5 0
3 years ago
HIGH POINTS!!! <br>List the creation date of each gaming console to exist.​
ANEK [815]

Answer:

Explanation:

The original Xbox: November 15, 2001

The original PS1: December 1, 1994

Xbox 360: November 22, 2005

Ps2: March 4, 2000

Ps3: November 11, 2006

Xbox One: November 22, 2013

Ps4: November 15, 2013

Nintendo Ds: November 21, 2004

Nintendo 3ds: February 26, 2011

Gameboy: April 21, 1989

Nintendo Switch: March 3, 2017

7 0
3 years ago
Which of the following is a basic concept associated with Web 2.0? Select one: a. shift in user's role from the passive consumer
soldier1979 [14.2K]

Answer:

A: shift in user's role from the passive consumer of content to its creator

Explanation:

During the phase of Web 2.0, consumers evolved from just been highly informed and socially connected (in other words, they evolved from being just passive consumers) to a more engaged and empowered consumer. This implied that consumers could easily adapt to new technologies to meet individual needs and create an emotional bond with brands. They evolved from passive consumers to being the creators of what they wanted to meet their specific needs.

5 0
3 years ago
Mica's creating his web page with a software that is free of charge for the first month. If he likes the program, he will have t
Katarina [22]
The answer is C. Shareware
4 0
3 years ago
Read 2 more answers
How do I insert a row in between 1 and 2 in excel?
Vlada [557]
This link should help: https://uhasct.com/insert-an-empty-row-between-each-row-of-data-in-excel/
5 0
3 years ago
Read 2 more answers
Other questions:
  • Which best describes inserting a table using the Table Gallery
    10·2 answers
  • What was one of the first inventions that made it possible to communicate almost instantly?
    11·1 answer
  • ________ is a model of computing in computer processing, storage, software, and other services which are provided as a shared po
    9·1 answer
  • Ted has $55.00 in his pocket. Which purchase will he be able to pay for with cash?
    9·2 answers
  • A type of multiprocessor chip that provides two or more separate and independent CPUs.
    8·1 answer
  • Differentiate between perfect and imperfect market​
    14·1 answer
  • Each drop-down menu.
    8·1 answer
  • What is smarta Art ? ​
    10·1 answer
  • NO LINKS Please
    8·2 answers
  • PLS HELP MEE it's due in 2 minutes​
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!