From 84b44eecfc17f9145042b14dcdd46d825afb7653 Mon Sep 17 00:00:00 2001 From: Vaidehi Bhardwaj <61655574+Vaidehi0421@users.noreply.github.com> Date: Thu, 1 Oct 2020 02:04:55 +0530 Subject: [PATCH 1/3] Added a program in C --- C/program-51/README.md | 3 +++ C/program-51/program.c | 15 +++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 C/program-51/README.md create mode 100644 C/program-51/program.c diff --git a/C/program-51/README.md b/C/program-51/README.md new file mode 100644 index 00000000..53ea2daf --- /dev/null +++ b/C/program-51/README.md @@ -0,0 +1,3 @@ +Program 51 + +Write a program in C to calculate the number of vowels and consonants in a string. diff --git a/C/program-51/program.c b/C/program-51/program.c new file mode 100644 index 00000000..a015c6b9 --- /dev/null +++ b/C/program-51/program.c @@ -0,0 +1,15 @@ +#include + +int main() { + char ch[100]; + int i,count; + printf("Enter the string \n"); + fgets(ch,100,stdin); + for(i=0;ch[i]!='\0';i++) + { + if(ch[i]=='a'||ch[i]=='e'||ch[i]=='i'||ch[i]=='o'||ch[i]=='u'||ch[i]=='A'||ch[i]=='E'||ch[i]=='I'||ch[i]=='O'||ch[i]=='U') + count++; + } + printf("Number of vowels are %d \n",count); + printf("Number of consonants are %d",(i-count)); +} \ No newline at end of file From 35979796ab9a6cb2b46e351d0ece28fc4d9ccaae Mon Sep 17 00:00:00 2001 From: Vaidehi Bhardwaj <61655574+Vaidehi0421@users.noreply.github.com> Date: Thu, 1 Oct 2020 17:33:40 +0530 Subject: [PATCH 2/3] Update and rename C/program-51/README.md to C/program-56/README.md --- C/{program-51 => program-56}/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) rename C/{program-51 => program-56}/README.md (87%) diff --git a/C/program-51/README.md b/C/program-56/README.md similarity index 87% rename from C/program-51/README.md rename to C/program-56/README.md index 53ea2daf..cdda9057 100644 --- a/C/program-51/README.md +++ b/C/program-56/README.md @@ -1,3 +1,4 @@ -Program 51 +Program 56 + Write a program in C to calculate the number of vowels and consonants in a string. From edf67fd34870b65133da37b18dd92bd37305394e Mon Sep 17 00:00:00 2001 From: Vaidehi Bhardwaj <61655574+Vaidehi0421@users.noreply.github.com> Date: Thu, 1 Oct 2020 17:37:30 +0530 Subject: [PATCH 3/3] Rename C/program-51/program.c to C/program-56/program.c --- C/{program-51 => program-56}/program.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename C/{program-51 => program-56}/program.c (99%) diff --git a/C/program-51/program.c b/C/program-56/program.c similarity index 99% rename from C/program-51/program.c rename to C/program-56/program.c index a015c6b9..12d30de1 100644 --- a/C/program-51/program.c +++ b/C/program-56/program.c @@ -12,4 +12,4 @@ int main() { } printf("Number of vowels are %d \n",count); printf("Number of consonants are %d",(i-count)); -} \ No newline at end of file +}