fork(16) download
  1. #include <stdio.h>
  2. main() {
  3. char *x,*y;
  4. int count=0;
  5. int f=0;
  6. char a[]="anna";
  7. char b[]="banana";
  8. //printf("%s\t%s\t",a,b);
  9. x=a; y=b;
  10. while(*y){
  11. if(*x==*y){
  12. x++;
  13. f=1;
  14. }
  15. if(f==1)count++;
  16. *y++;
  17. }
  18. if (*x!='\0')
  19. printf("\n false (%s)\n",x);
  20. else
  21. printf("\ntrue %d\n",count);
  22.  
  23. }
Runtime error #stdin #stdout 0s 2248KB
stdin
Standard input is empty
stdout
true 7