Question

1. Write a for loop the prints the letter A through Z in reverse. This means...

1. Write a for loop the prints the letter A through Z in reverse. This means that your output should be Z Y X ... A.

It does not matter if all letters are on one line or each on a line by itself. I am looking for the logic.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include <stdio.h>
int main()
{
for(char i='Z';i>='A';i--)
printf("%c ",i);
return 0;
}

public class Main
{
   public static void main(String[] args)
   {
       for(char i='Z';i>='A';i--)
System.out.printf("%c ",i);
   }
}

#include <stdio.h> int main() o vou AWN for(char i='z';i>='A';i--) printf("%c ", i); return 0; input ZYXWV UTSRQPONMLKJIHGFEDCBA ... Program finished with exit code o Press ENTER to exit console.

Add a comment
Know the answer?
Add Answer to:
1. Write a for loop the prints the letter A through Z in reverse. This means...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 1. Write a python program that reads a file and prints the letters in increasing order...

    1. Write a python program that reads a file and prints the letters in increasing order of frequency. Your program should convert entire input to lower case and only counts letters a-z. Special characters or spaces should not be counted. Each letter and it's occurrences should be listed on a separate line. 2. Test and verify your program and it's output. ---Please provide a code and a screenshot of the code and output. Thank you. ----

  • I want to write a code in phyton that prints only letters from input but skips...

    I want to write a code in phyton that prints only letters from input but skips two and prints one. I want my program to do this; input = 2ab4c#fd56gjl output = afj So it should completely ignore any character other than letters and print the letters by skipping 2. (Should i use for loop? My classes just beyan so i am guessing the answer code should be a primitive code.)

  • Python programming Question 1: Write a script with a for loop that prints each character in...

    Python programming Question 1: Write a script with a for loop that prints each character in your first name written as first initial capital and other small, followed by its ASCII value on the screen.  Use appropriate functions to get character value to ASCII code. (Hint: Functions discussed in lectures)  For example, the output of each iteration should be as -- for ‘A’, it should print A followed by its ASCII value. Question 2: Write a script that...

  • Write a C++ program that inputs a single letter and prints out the corresponding digit on the...

    Write a C++ program that inputs a single letter and prints out the corresponding digit on the telephone.The letters and digits on a telephone are grouped this way:2 = ABC 4 = GHI 6 = MNO 8 = TUV3 = DEF 5 = JKL 7 = PRS 9 = WXYNo digits correspond to either Q or Z. For these two letters, your program should print a messageindicating that they are not used on a telephone. If a letter in lower...

  • Letter Count : Write a Python script that reads a file and outputs the number of...

    Letter Count : Write a Python script that reads a file and outputs the number of words that start with each letter. This means that for every letter we want to count the total number of (nonunique) words that begin with that letter. In your implementation you should ignore the letter case, i.e., consider all words as lower case. Output the results in the following format (below values are hypothetical): a or A: 120 b or B: 460 c or...

  • Write a program that calculates the frequency of letter occurrences in text. Read ASCII text from...

    Write a program that calculates the frequency of letter occurrences in text. Read ASCII text from standard input. On reaching EOF, print to stdout the normalized frequency of occurrence for each letter a-z that appeared in the input, one per line, in alphabetical order using the format produced by printf( "%c %.4f\n", letter, freq); Letters that occur zero times should not appear in the output. Characters other than lower and upper case letters should be ignored. Lower and upper case...

  • Write a function named vertical that accepts a string as its parameter and prints each letter...

    Write a function named vertical that accepts a string as its parameter and prints each letter of the string on separate lines. For example, a call of vertical("hey now") should produce the following output: h e y n o w

  • i need python code, thank you very much! characters) and prints ) 3. Write function, smallestCharacterLargerThan(keyChar,...

    i need python code, thank you very much! characters) and prints ) 3. Write function, smallestCharacterLargerThan(keyChar, inputString) that takes as input key character, keyChar, and a string of one or more letters (and no other the "smallest" character in the string that is larger than keyChar, where one character is smaller than another if it occurs earlier in the alphabet (thus 'C is smaller than 'y' and both are larger than 'B') and 2) the index of the final occurrence...

  • 1.Write exactly one for loop statement that prints this column of nine words: snake frog snake...

    1.Write exactly one for loop statement that prints this column of nine words: snake frog snake frog snake frog snake frog snake Enter your loop statement in the box below. Question 2. 5 points Suppose s is any String. Write a loop that prints s backwards, and with the symbol - (dash), printed twice, between pairs of characters and also at the very end: If s is "horse", your loop should print e--s--r--o--h-- If s is "pig", your loop should...

  • Write a complete C program that inputs a paragraph of text and prints out each unique...

    Write a complete C program that inputs a paragraph of text and prints out each unique letter found in the text along with the number of times it occurred. A sample run of the program is given below. You should input your text from a data file specified on the command line. Your output should be formatted and presented exactly like the sample run (i.e. alphabetized with the exact spacings and output labels). The name of your data file along...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT