Advertisments

C Program To Secure Out Whether or no longer A Given String Is An Identifier Or No longer

C program to search out out whether a given string is an identifier or no longer.
A string is believed as an identifier when he follows these principles:

  • The principle letter must always be alphabet(each and each capital or limited i.e. A-Z,a-z) or underscore(_).
  • After first letter it accommodates sequence of alphabet or digits(0-9) or underscore(_) but no longer dangle any particular symbol(#,@,$,%,^,& and so on.) and apartment( ).

Suggested:  Java programming (rookies)

#consist of
#consist of
#consist of
important (){ //code by techbytebox.com
char string [50];
printf (“Enter designate to be identified: “);
scanf (“%s”, string);
int length = strlen (string) – 1;
bool alpha_string = spurious;
if ( string [0] >= ‘A’ && string [0] <= 'Z' )
alpha_string = true;
if ( string [0] >= ‘a’ && string [0] <= 'z' )
alpha_string = real;
bool underScore = real;
if ( string [length] == ‘_’ )
underScore = spurious;
int num = 0;
for ( int i = 1; i <= length; i++ ) {
if ( string [i] == ‘_’ )
num++;
else
num = 0;
if ( num == 2 ) {
underScore = spurious;
rupture;
}}
if ( alpha_string && underScore)
printf (“Resolution: %s is a edifying identifiern”, string);
else
printf (“Resolution: %s will not be any longer a edifying identifiern”, string);
getche();
} //code by Afolabi Achiever (techbytebox)

Suggested: Entire Manual on How you are going to be in a position to set up Xampp
I’m hoping your C Program compiles with out error?? in that case edifying drop a comment and we could be jubilant to permit you to out, else share this page with your programming chums by procedure of any of the social media listed below.
Post a Comment (0)
Previous Post Next Post
Jobs Alert To Get Latest Jobs Alerts
Join Our Facebook Page Join Over Facebook Page To Lastest Jobs Update And Notification