#include<stdio.h>
#include<string.h>
main()
{
char a[24];
int i,count=0,j=0,stlen,k,substlen,sig=0;
gets(a);
for(i=0;i<strlen(a);i++)
{if(a[i]==' ')
break;
else j++;}
stlen=j;
substlen=strlen(a)-j-1;
for(i=0;i<=stlen-substlen;i++)
{count=0;
for(k=i+substlen-1;k>=i;k--)
{if(a[k]!=a[k+stlen-i+1])
break;
else count++;}
if(count==substlen)
{sig=1;
break;
}
}
printf("%d",sig);
}
input-
11100101 1001
110010 111
output-
1
0
note -give the main string and the substring(to be checked) seperated by a space.
Check the functions or methods in the language of your choice; there probably already is something pre-programmed.
If this is a programming exercise, you would have to write a loop that checks from each position of the string in which you are searching. Write a second loop that compares each character.
Check the functions or methods in the language of your choice; there probably already is something pre-programmed.
If this is a programming exercise, you would have to write a loop that checks from each position of the string in which you are searching. Write a second loop that compares each character.
Check the functions or methods in the language of your choice; there probably already is something pre-programmed.
If this is a programming exercise, you would have to write a loop that checks from each position of the string in which you are searching. Write a second loop that compares each character.
Check the functions or methods in the language of your choice; there probably already is something pre-programmed.
If this is a programming exercise, you would have to write a loop that checks from each position of the string in which you are searching. Write a second loop that compares each character.
Check the functions or methods in the language of your choice; there probably already is something pre-programmed.
If this is a programming exercise, you would have to write a loop that checks from each position of the string in which you are searching. Write a second loop that compares each character.
The location of a substring within a string in JavaScript can be found using the indexOf() method of the string type. That method will return the placement of a string as a numerical index, starting from 0. The method takes two arguments. The first is the substring you're looking for. In this case "e." The second argument is optional, and it's the "start" argument. If you define it, you define the index from which JavaScript will start looking for the substring. By default, this index is 0 (zero.) If you want to find all of the occurrences of a string using this method, you have to write a loop. To see a working example of that, check out the JSFiddle in the related links. I've also attached a good lesson on JavaScript strings in PDF.
Active Time spent online
That's easy to do!This script will get the POST data from an HTML form and check if it is a vowel.
/*To check whether a string is palindrome*/includeincludevoid main () { int i,j,f=0; char a[10]; clrscr (); gets(a); for (i=0;a[i]!='\0';i++) { } i--; for (j=0;a[j]!='\0';j++,i--) { if (a[i]!=a[j]) f=1; } if (f==0) printf("string is palindrome"); else printf("string is not palindrome"); getch (); }
The check sum8 of hex string 0221323DA3B4 is E9.
Check the documentation of the String class, for a method that searches for a substring.
The location of a substring within a string in JavaScript can be found using the indexOf() method of the string type. That method will return the placement of a string as a numerical index, starting from 0. The method takes two arguments. The first is the substring you're looking for. In this case "e." The second argument is optional, and it's the "start" argument. If you define it, you define the index from which JavaScript will start looking for the substring. By default, this index is 0 (zero.) If you want to find all of the occurrences of a string using this method, you have to write a loop. To see a working example of that, check out the JSFiddle in the related links. I've also attached a good lesson on JavaScript strings in PDF.
Use the Exception class and type converters.
Active Time spent online
That's easy to do!This script will get the POST data from an HTML form and check if it is a vowel.
/*To check whether a string is palindrome*/includeincludevoid main () { int i,j,f=0; char a[10]; clrscr (); gets(a); for (i=0;a[i]!='\0';i++) { } i--; for (j=0;a[j]!='\0';j++,i--) { if (a[i]!=a[j]) f=1; } if (f==0) printf("string is palindrome"); else printf("string is not palindrome"); getch (); }
8086 assembly language program to check wether given number is perfect or not
To check if a string is a palindrome, point to each end of the string and work inwards towards the middle. If the characters pointed at differ, the string is not a palindrome. When the pointers meet or cross each other, the string is a palindrome. Note that the string cannot contain whitespace or punctuation and comparisons must not be case-sensitive.
The check sum8 of hex string 0221323DA3B4 is E9.
Write your program and if you are having a problem post it here with a description of the problem you are having. What you are asking is for someone to do your homework for you.
You can do this: <?php if ( $word === strrev( $word ) ) { echo "The word is a palindrome"; } else { echo "The word is not a palindrome"; }
presence check is when you validate a pieve of unsure information on bullying eg, therefore if you were to be validating the real gender of someone then presence check would not apply to you, whereas if you were to be validating a presence of a person this would very much apply to you.