![glamorouspotato1251](/avatars/20581.jpg)
glamorouspotato1251
25.10.2019 •
Computers and Technology
Write a function chat accepts a pointer to a c-string as its argument. the function should count the number of vowels appearing in the sering and rerurn that number. write another function that accepts a pointer to a c-string as its argument. this function should count the number of consonants appearing in the string and return that number. demonstrate these two functions in a program rhar performs the following steps: i. the user is asked to enter a string. 2. the program displays the following menu: a) count the number of vowels in rhe string 8) count the number of consonants in the string c) count both the vowels and consonants in the string d) enter another string e) exit the program 3. the program performs the operation selected by the user and repeats until the user selects e to exit the program.
Solved
Show answers
More tips
- H Health and Medicine How to Calculate Your Ideal Weight?...
- S Style and Beauty Discover the Art of Nail Design: How Do You Paint Your Nails?...
- P Philosophy How to Develop Extrasensory Abilities?...
- O Other Everything You Need to Know About Kudyabliks...
- C Computers and Internet The Twitter Phenomenon: What it is and How to Use it...
- C Computers and Internet How to Choose a Laptop: Expert Guide and Tips...
- C Computers and Internet How to Choose a Monitor?...
- H Horoscopes, Magic, Divination Where Did Tarot Cards Come From?...
- S Style and Beauty How to Make Your Lips Fuller? Ideas and Tips for Beautiful Lips...
- C Computers and Internet How to Learn to Type Fast?...
Answers on questions: Computers and Technology
- C Computers and Technology NO THIS ISNT ANY HOMEWORK! Does anyone know a laptop under $200 that can run Minecraft Java edition and maybe 60fps? PLEASE NAME A SPECIFIC ONE not to be rude but please don’t...
- C Computers and Technology IVD. IIIcelTICISTUSTUSE LIICIULUI 1.12. Which of the two systems do you think will need the largest motor? Explain your answer....
- M Mathematics In the diagram below, \text{m}\angle A = 59^{\circ},m∠A=59 ∘ , \text{m}\angle B = 55^{\circ}m∠B=55 ∘ and \text{m}\angle C = 78^{\circ}.m∠C=78 ∘ . Find \text{m}\angle D.m∠D....
- M Mathematics Need this ASAP thanks...
- A Arts Name the song: I m so SHINEY! idk how to spell rn, o...
- E English Write an article on The increasing crime rate in today s society and ways to curb it...
- M Mathematics Which of the following sets of numbers could represent the three sides of a right triangle?...
- B Biology Which statement describes the proper procedure for identifying an organism by using a dichotomous key? O A Geographical locations of organisms are studied to determine an organism...
- M Mathematics Please help me solve this problem...
- H History What s unique about underground mining...
Ответ:
Function contains into the code asked for:
Receives a string as an argument. count the number of vowels in the string and return that number. receives a string as an argument. count the number of consonants in the string and return that number.Explanation:
//Let's call libraries
#include <stdio.h>
#include <conio.h>
//Start main
int main()
{
//*Declare functions for counting number of vowels and consonants
int vowels=0;
int consonants=0;
int all=0;
//Output need information
//Ask user to input a string
printf("what do you want to count?\n");
printf("1-the vowels.\n");
printf("2-the consonants.\n");
printf("3-all of the letters on a phrase.\n");
printf("\n");
printf("-> ");
int a;
a = getchar();
switch (a)
{
//Ask user what function they want to run
case '1':
//Call the function needed to count the vowels
printf("Introduce a phrase: ");
char textoa[1001];
scanf("%s", &textoa);
char *p;
p = textoa;
while (*p != '\0')
{
if (*p == 'a' || *p == 'e' || *p == 'i' || *p == 'o' || *p == 'u' || *p == 'A' || *p == 'E' || *p == 'I' || *p == 'O' || *p == 'U') vocales ++;
p++;
}
printf("there are %d vowels.", vowels);
break;
case '2':
//Call the function needed to count the consonants
printf("Introduce a phrase: ");
char textob[1001];
scanf("%s", &textob);
p = textob;
while (*p != '\0')
{
if (*p == 'b' || *p == 'B' || *p == 'c' || *p == 'C' || *p == 'd' || *p == 'D' || *p == 'f' || *p == 'F' || *p == 'g' || *p == 'G' || *p == 'h' || *p == 'H' || *p == 'j' || *p == 'J' || *p == 'k' || *p == 'K' || *p == 'l' || *p == 'L' || *p == 'm' || *p == 'M' || *p == 'n' || *p == 'N' || *p == 'p' || *p == 'P' || *p == 'q' || *p == 'Q' || *p == 'r' || *p == 'R' || *p == 's' || *p == 'S' || *p == 't' || *p == 'T' || *p == 'v' || *p == 'V' || *p == 'w' || *p == 'W' || *p == 'x' || *p == 'X' || *p == 'y' || *p == 'Y' || *p == 'z' ||
*p == 'Z') consonants ++;
p++;
}
printf("there are %d consonants.", consonants);
break;
case '3':
printf("Introduce a phrase: ");
char textoc[1001];
scanf("%s",&textoc);
p = textoc;
while (*p != '\0')
{
if (*p == 'a' || *p == 'e' || *p == 'i' || *p == 'o' || *p == 'u' || *p == 'A' || *p == 'E' || *p == 'I' || *p == 'O' || *p == 'U' || *p == 'b' || *p == 'B' || *p == 'c' || *p == 'C' || *p == 'd' || *p == 'D' || *p == 'f' || *p == 'F' || *p == 'g' || *p == 'G' || *p == 'h' || *p == 'H' || *p == 'j' || *p == 'J' || *p == 'k' || *p == 'K' || *p == 'l' || *p == 'L' || *p == 'm' || *p == 'M' || *p == 'n' || *p == 'N' || *p == 'p' || *p == 'P' || *p == 'q' || *p == 'Q' || *p == 'r' || *p == 'R' || *p == 's' || *p == 'S' || *p == 't' || *p == 'T' || *p == 'v' || *p == 'V' || *p == 'w' || *p == 'W' || *p == 'x' || *p == 'X' || *p == 'y' || *p == 'Y' || *p == 'z' || *p == 'Z') all ++;
p++;
}
printf("there are %d letters on the phrase.", all); break;
} getch();
}
Ответ:
The correct formula that is going to add up the values in the listed cells is =A1+A2+A3+A4+A5.
This formula will add up the individual values in each of the five cells and put the answer in the cell where you enter the formula.
Another formula that you can use to get the same value is to use the =SUM function. By entering =SUM(A1:A5) in the cell it will generate the total of all of the values in the cells between A1 and A5.