Can someone please check my syntax? Thanks.
The program runs but the output has some kind of error.
Thanks.
#include<stdio.h>
#include<conio.h>
#include<string.h>
void Pig_Latin_Converter()
{ char str[50];
char nv[50]="yay";
char c[50]="ay";
char key[]="aeiou";
char keys[]="bcdfghjklmnpqrstvwxyz";
char test[20];
char *p=str;
scanf("%s",str);
{ p=strpbrk(str,key);
if(str!=p)
{ strcat(str,nv);
printf("Output: %s", str); } }
{ p=strpbrk(str,key);
if(str==p)
{ strcat(str,nv );
printf("Output: %s",str); } }
{ p=strpbrk(str,keys);
if(str==p)
{ char *p=str;
p++;
test[0] = str[0];
strcat(p,test);
strcat(p,c);
printf("\nOutput: %s",p);} }
}
void main()
{ clrscr();
Pig_Latin_Converter();
getch();
}