what are the advantage of pointer variables? write a program
to count the number of vowels and consonants in a given string

Answer Posted / gaurav kumar

#include <stdio.h>

int vowel;
int consonant;

void check_vowel(char c)
{
if ( c != 'a' && c != 'e' && c != 'i' && c != 'o' && c != 'u' && c != 'A' && c != 'E' && c != 'I' && c != 'O' && c != 'U')
consonant ++;
else
vowel++;
return;
}

int main(void) {
char p[25];
char *ptr=p;

printf("Enter a string:");
scanf(" %[^\n]25s",p);

printf("%s\n",p);
printf("%c\n",*p);

while(*ptr != '\0')
{
if(*ptr != ' ')
check_vowel(*ptr);
ptr++;
}
printf("The number of vowels : %d and consonants : %d in %s \n",vowel,consonant,p);

return 0;
}

Please mail me if any compact solution?

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how do you print an address?

652


What is your stream meaning?

596


PLS U SENS ME INTERVIEW O. MY EMAIL ADD, SOFIYA.SINGH@GMAIL.COM

1699


What is #line?

603


largest Of three Number using without if condition?

993






any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above

649


Where define directive used?

596


Why can't I perform arithmetic on a void* pointer?

631


What are the c keywords?

742


What is merge sort in c?

636


What is a void * in c?

589


please help me..... please codes and flowchart plz turbo c lang po yan.....please asap response... 3. Make an astrology program. The user types in his or her birthday (month, day, and year as integer), and the program responds with the user’s zodiac sign, horoscope, and other information related to it. If the user’s birth year falls into a leap year, your program should display an appropriate message for it. NOTES: Conditional Statements: it should be with graphics

2854


How to delete a node from linked list w/o using collectons?

2082


What is c mainly used for?

591


Is null a keyword in c?

728