#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
int i,flag=0,m;
char s[5][10]={"if","else","goto","continue","return"},st[10];
clrscr();
printf("\n enter the string");
gets(st);
for(i=0;i<5;i++)
{
m=strcmp(st,s[i]);
if(m==0)
flag=1;
}
if(flag==0)
printf("\n it is not keyword");
else
printf("\n it is a keyword");
getch();
}
It's by design; this way the lexical parser is able to decide that any given string is a keyword or an identifier.
.... String line = "This is example program with spaces"; String[] tokens = line.split(" "); System.out.println(tokens.length-1); .......
a promlem to solve an equation or a assigment
One way to do this is to convert the number to a String, then use the corresponding String method to find out the length of the String.
/*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 (); }
It's by design; this way the lexical parser is able to decide that any given string is a keyword or an identifier.
8086 assembly language program to check wether given number is perfect or not
.... String line = "This is example program with spaces"; String[] tokens = line.split(" "); System.out.println(tokens.length-1); .......
a promlem to solve an equation or a assigment
No.
An identifier is the names given for labels, functions and variables in the c language.
One way to do this is to convert the number to a String, then use the corresponding String method to find out the length of the String.
/*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 (); }
You usually do not need to delete a String, since when the program no longer refers to it, the garbage collector will clean it up.
Return an iterator to the string if it exists, or the container's end iterator if it does not.
That's easy to do!This script will get the POST data from an HTML form and check if it is a vowel.
This functionality is already in Java. String.toLowerCase() and String.toUpperCase() will take care of it for you.