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. ----

  • 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 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...

  • Exercise 3: Write a program that reads a file and prints the letters in decreasing order...

    Exercise 3: Write a program that reads a file and prints the letters in decreasing order of frequency. Your program should convert all the input to lower case and only count the letters a-z. Your program should not count spaces, digits, punctuation, or anything other than the letters a-z. Find text samples from several different languages and see how letter frequency varies between languages. Compare your results with the tables at https://wikipedia.org/wiki/Letter_frequencies. PYTHON PLEASE the text can be found here...

  • Write a Python program to check whether a character entered as input is a vowel or...

    Write a Python program to check whether a character entered as input is a vowel or consonant. A vowel is any letter that is “a”, “e”, “i”, “o”, or “u”, and a consonant is all other letters. In addition, put in a statement that catches and prints out that “y” is either a consonant or a vowel. Example input: Please give a letter: aa Please enter only one letter: a Example output: Your letter a is a vowel.

  • C++ please Write a program that reads the following sentences from a file: I am Sam...

    C++ please Write a program that reads the following sentences from a file: I am Sam Sam I am That Sam I am That Sam I am I do not like that Sam I am Do you like green eggs and ham I do not like them But I do like spam! You will first have to create the text file containing the input, separate from your program. Your program should produce two output files: (i) (ii) one with the...

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
ADVERTISEMENT