answersLogoWhite

0

#include<stdio.h>

#include<conio.h>

#include<string.h>

#include<stdlib.h>

#include<process.h>

void main()

{

clrscr();

char *s1,*s2,*o1,*o2,temp1,temp2;

printf("Enter first statement:");

gets(s1);

printf("Enter second statement:");

gets(s2);

if(s1[0]!=s2[0])

{

printf("Sorry");

getch();

exit(0);

}

o1[0]=s1[0];

o1[1]='-';

o1[2]='>';

for(int i=3;s1[i]==s2[i];i++)

o1[i]=s1[i];

temp1=i;

temp2=i;

o1[i++]='Z';

o1[i++]='\0';

o2[0]='Z';

o2[1]='-';

o2[2]='>';

int p=3;

for(int j=temp1;j<strlen(s1);j++)

{ o2[p]=s1[j];

p++;

}

o2[p++]='/';

for(j=temp2;j<strlen(s2);j++)

{

o2[p]=s2[j];

p++;

}

o2[p++]='\0';

puts(o1);

puts(o2);

getch();

}

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

How two write c program for left factoring in given grammar?

To implement left factoring in a given grammar using C, first, identify the common prefixes in the production rules. Create a new non-terminal symbol to represent the factored part, and rewrite the productions accordingly. Use a function to parse the grammar, detect the common prefixes, and generate the factored grammar. Finally, display the updated grammar with the left-factored rules.


What is spelled correctly a-grammar b-grammar c-gramar d-gramer?

Grammar


Comparison of c means in a one-factor anova is the same as using c repeated t-tests a true b false?

a


What is Easy Grammar Plus?

Easy Grammar Plus is a easy grammar homeschool curriculum by Wanda C. Phillips, Ed.D.


What has the author C B Greiss written?

C. B. Greiss has written: 'A German grammar' -- subject(s): German language, Grammar


What is spelled correctly A grammar B grammar C gramar D gramer?

(B) The word for the application of proper English usage is "grammar".


What has the author Nora C England written?

Nora C. England has written: 'Mam grammar in outline' -- subject(s): Grammar, Mam language


What has the author H C Scholberg written?

H. C. Scholberg has written: 'Concise grammar of the Hindi language' -- subject(s): Grammar, Hindi language


How do you factor C squared plus C minus 56?

Well, honey, to factor that little equation C squared plus C minus 56, you're gonna want to break out the ol' quadratic formula. Factor that bad boy into (C + 8)(C - 7) and call it a day. Trust me, it's as easy as stealing candy from a baby.


What has the author Robert C Pinckert written?

Robert C. Pinckert has written: 'Pinckert's practical grammar' -- subject(s): Accessible book, Rhetoric, Grammar, English language


Why cricket starts from c but not from k?

Cricket starts with c but not k because that is the correct grammar.


How do you factor the polynomial c2-d2?

0