0

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();
}
4
Contributors
4
Replies
6
Views
6 Years
Discussion Span
Last Post by YAMNA MIDHAT
0

We're not here to fix all of your problems. Learn to debug your own code. If you have a specific problem, ask a specific question.

0

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();
}

can you please give me the algorithm to convert English into Latin .I want an example like if there is a word "test" than what would be it in Latin.

Edited by YAMNA MIDHAT: n/a

0

can you please give me the algorithm to convert English into Latin .I want an example like if there is a word "test" than what would be it in Latin.

1) Buy a Latin-English Dictionary.
2) Look up English word in the dictionary.
3) Read the Latin translation given.
4) Use the Latin word 10 times that day and the word will be yours to use.

0

1) Buy a Latin-English Dictionary.
2) Look up English word in the dictionary.
3) Read the Latin translation given.
4) Use the Latin word 10 times that day and the word will be yours to use.

thanks alot.:yawn:

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.