-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharray2
More file actions
48 lines (38 loc) · 974 Bytes
/
Copy patharray2
File metadata and controls
48 lines (38 loc) · 974 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.
*******************************************************************************/
#include <stdio.h>
#define MAXLINE 100
int i, c, len, x = 0;
char sa[MAXLINE + 1];
char pa[MAXLINE + 1];
int
main ()
{
printf ("enter string\n");
while ((c = getchar ()) != '\n')
{
sa[i++] = c;
}
i=0;
printf ("enter search characters\n");
while ((c = getchar ()) != '\n')
{
pa[i++] = c;
}
for (x=0; x<MAXLINE && len ==0 ; x++)
{
while (len==0)
{
for (i=0; i<MAXLINE && len == 0 ; i++)
if (sa[i] == pa[x])
len++;
}
}
if (len !=0)
printf("\nHIT!!!\n");
return 0;
}