Warning: include(topsc.html): failed to open stream: No such file or directory in /home/eng123/public_html/sourcecode/c/unix/vfork.html on line 13

Warning: include(topsc.html): failed to open stream: No such file or directory in /home/eng123/public_html/sourcecode/c/unix/vfork.html on line 13

Warning: include(): Failed opening 'topsc.html' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/eng123/public_html/sourcecode/c/unix/vfork.html on line 13

Home
Source Codes
Engineering Colleges

Training  Reports
Seminar Reports
Placement Papers

Forums

   Computer Science / IT
   Electronics
   Electrical
   Mechanical
   Chemical
   Civil

   CAT / MBA

   GMAT / Foreign MBA
Latest Jobs

Engineering Jobs / Technical Jobs
Management Jobs

Sitemap
Terms of use

Displaying  Source Code(s)  
 


Warning: include(adsc.html): failed to open stream: No such file or directory in /home/eng123/public_html/sourcecode/c/unix/vfork.html on line 31

Warning: include(adsc.html): failed to open stream: No such file or directory in /home/eng123/public_html/sourcecode/c/unix/vfork.html on line 31

Warning: include(): Failed opening 'adsc.html' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/eng123/public_html/sourcecode/c/unix/vfork.html on line 31

 
vowels counting using vfork

--------------------------------------------------------------------------------

Description : C Program to find the vowels in the given string using vfork

#include<stdio.h>
#include<sys/types.h>
int main()
{
int j,n,a,i,e,o,u;
char str[50];
a=e=i=o=u=0;
pid_t pid;
if((pid=vfork())<0)
{
perror("FORK ERROR");
exit(1);
}
if(pid==0)
{
printf("
Counting Number of Vowels using VFORK");
printf("
-------- ------ -- ------ ----- -----");
printf("
Enter the String:");
gets(str);
_exit(1);
}
else
{
n=strlen(str);
for(j=0;j<n;j++)
{
if(str[j]=='a' || str[j]=='A')
a++;
else if(str[j]=='e' || str[j]=='E')
e++;
else if(str[j]=='i' || str[j]=='I')
i++;
else if(str[j]=='o' || str[j]=='O')
o++;
else if(str[j]=='u' || str[j]=='U')
u++;
}
printf("
Vowels Counting");
printf("
------ --------");
printf("
Number of A : %d",a);
printf("
Number of E : %d",e);
printf("
Number of I : %d",i);
printf("
Number of O : %d",o);
printf("
Number of U : %d",u);
printf("
Total vowels : %d<BR>,a+e+i+o+u);
exit(1);
}
}

 

 

 

Contribute content or training reports / feedback / Comments
job placement papers
All rights reserved copyright 123ENG