STRING1 - if(a[i+j]==b[j]) { printf(" * "); }...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
#include<stdio.h> #include<conio.h> void main() { int x,i=0,j,flag=1; char a[30],b[30],temp[60]; clrscr(); c printf("Enter two strings:"); p scanf("%s%s",&a,&b); s for(i=0;a[i];i++) { for(j=0;b[i];j++) { printf(" i %d j %d\n",i,j);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: if(a[i+j]==b[j]) { printf(" * "); } else { flag=1; break; } } } if(flag==0) {printf("\nit is a substring");} else if(flag==1) {printf("\nit is NOT a substring");} getch(); }...
View Full Document

This note was uploaded on 10/25/2010 for the course CMPN SEM3 taught by Professor Thakur during the Fall '07 term at University of Mumbai.

Ask a homework question - tutors are online