Question

C programming (not c++) This programs input is a series of words. All words consist of...

C programming (not c++)

This programs input is a series of words. All words consist of only lowercase letters(a-z), no uppercase letters or digits or punctuation or other special symbols. The program reads until end-of-file, and then prints out the lowercase letters that were not seen in the input. Enter your input: the quick brown fox jumps over the lazy old dog Missing letters: enter your input: roll tide missing letters: a b c f g h j k m n p q s u v w x y z hitns: use an array of 26 elements to store the number of times you've seen the characters a through z initialize that array to zeroes and the increment a given location when you see that letter recall that lowercase letters are ASCII 97 (a) through ASCII 122(z). If you subtract 97 from a given character, you get a value in the range of 0 to 25.

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

#include<stdio.h>
#include<string.h>

main()

{
int i=0;
int b[26];
for(i=0;i<26;i++)
{

b[i]=0;
}
char a[100000];
scanf(" %[^\n]s",&a);
int k=strlen(a);
for(i=0;i<k;i++)
{

if(a[i]<=122 && a[i]>=97)
{

b[a[i]-97]++;
}
}
printf("MISSING LETTERS:");
for(i=0;i<26;i++)
{

if(b[i]==0)
{

printf("%c ",97+i);
}
}
}

output:

roll tide
MISSING LETTERS:a b c f g h j k m n p q s u v w x y z

Add a comment
Know the answer?
Add Answer to:
C programming (not c++) This programs input is a series of words. All words consist of...
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
  • In C language This program reads in a series of words. All words consist of only...

    In C language This program reads in a series of words. All words consist of only lower-case letters ('a' through 'z'). None of the words entered will be longer than 50 letters. The program reads until ctrl-d (end-of-file), and then prints out all the lower-case letters that were missing in the input or a statement indicating the input has all the letters. Two executions of the program are shown below. Enter your input: the quick brown fox jumps over the...

  • I need eclipse code for : Write a program that analyzes text written in the console...

    I need eclipse code for : Write a program that analyzes text written in the console by counting the number of times each of the 26 letters in the alphabet occurs. Uppercase and lowercase letters should be counted together (for example, both ‘A’ and ‘a’ should count as an A). Any characters that are not letters should be ignored. You must prompt the user to enter the text to be analyzed. Then, for any letter that appeared at least once...

  • ‘C’ programming language question Write a MENU DRIVEN program to A) Count the number of vowels...

    ‘C’ programming language question Write a MENU DRIVEN program to A) Count the number of vowels in the string B) Count the number of consonants in the string C) Convert the string to uppercase D) Convert the string to lowercase E) Display the current string X) Exit the program The program should start with a user prompt to enter a string, and let them type it in. Then the menu would be displayed. User may enter option in small case...

  • Write a program that prompts for a sentence and calculates the number of uppercase letters, lowercase...

    Write a program that prompts for a sentence and calculates the number of uppercase letters, lowercase letters, digits, and punctuation. Output the results neatly formatted and labeled in columns. how I can make this program in a more simple way. # get user input user_string = input("Enter a sentence: ") # create and initialize variables upper_case = 0 lower_case = 0 digits = 0 spaces = 0 punctuations = 0 x = len(user_string) #loop conditions and increment for i in...

  • I want to implement a caesae cypher program in C given input.txt to be cyphered. for example. ass...

    i want to implement a caesae cypher program in C given input.txt to be cyphered. for example. assume the file input.txt contains 'THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG' when i run $./cypher input.txt 3 on terminal we get out put of 'WKH TXLFN EURZQ IRA MXPSV RYHU WKH ODCB GRJ' 10- Coding Style 15 - Compilation 10 - Makefile with default, clean, and run rules 05 - Code is warning free 75- Implementation 05 pts - Deals...

  • In this program, you will be using C++ programming constructs, such as overloaded functions. Write a...

    In this program, you will be using C++ programming constructs, such as overloaded functions. Write a program that requests 3 integers from the user and displays the largest one entered. Your program will then request 3 characters from the user and display the largest character entered. If the user enters a non-alphabetic character, your program will display an error message. You must fill in the body of main() to prompt the user for input, and call the overloaded function showBiggest()...

  • You're to write a C++ program that analyzes the contents of an external file called data.txt....

    You're to write a C++ program that analyzes the contents of an external file called data.txt. (You can create this file yourself using nano, that produces a simple ASCII text file.) The program you write will open data.txt, look at its contents and determine the number of uppercase, lowercase, digit, punctuation and whitespace characters contained in the file so that the caller can report the results to stdout. Additionally, the function will return the total number of characters read to...

  • please use c++ please write down the input file information please add comments for some codes...

    please use c++ please write down the input file information please add comments for some codes please do not use #include <bits/stdc++.h> we did not learn it yet thank you CSIT 575-Take Home Lab #11: Arrays To learn to code, compile and run a program processing characters. Assignment Plan and code a top-down modular program utilizing ARRAYS to solve the following problem, using at least 3 functions (called from the main() section or from another function) to solve the problem....

  • Write a C++ program that prompts the user with the following menu options: [E]rase–ArrayContent [C]ount–Words [R]ev–Words...

    Write a C++ program that prompts the user with the following menu options: [E]rase–ArrayContent [C]ount–Words [R]ev–Words [Q]uit 1. For Erase–ArrayContent option, write complete code for the C++ function Erase described below. The prototype for Erase is as follows: void Erase( int a[ ], int * N, int * Search-Element ) The function Erase should remove all occurrences of Search-Element from the array    a[ ]. Note that array a[ ] is loaded with integer numbers entered by the user through the...

  • Write a C++ program that prompts the user with the following menu options: Erase-ArrayContent Count-Words Quit...

    Write a C++ program that prompts the user with the following menu options: Erase-ArrayContent Count-Words Quit 1. For Erase-ArrayContent option, write complete code for the C++ function Erase described below. The prototype for Erase function is as follow: void Erase( int a[ ], int * N, int * Search-Element) The function Erase should remove all occurrences of Search-Element from the array al). Note that array a[ ] is loaded with integer numbers entered by the user through the keyboard. N...

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