Advertisments

C Program To Receive Out Whether A Given String Is An Identifier Or Now not

C program to gain out whether a given string is an identifier or no longer.
A string is is called an identifier when he follows these rules:

  • The predominant letter ought to be alphabet(every capital or exiguous i.e. A-Z,a-z) or underscore(_).
  • After first letter it contains sequence of alphabet or digits(0-9) or underscore(_) nonetheless no longer agree with any special image(#,@,$,%,^,& and heaps others.) and plot( ).

Urged:  Java programming (novices)

#encompass
#encompass
#encompass
predominant (){ //code by techbytebox.com
char string [50];
printf (“Enter imprint to be identified: “);
scanf (“%s”, string);
int length = strlen (string) – 1;
bool alpha_string = false;
if ( string [0] >= ‘A’ && string [0] <= 'Z' )
alpha_string = true;
if ( string [0] >= ‘a’ && string [0] <= 'z' )
alpha_string = correct;
bool underScore = correct;
if ( string [length] == ‘_’ )
underScore = false;
int num = 0;
for ( int i = 1; i <= length; i++ ) {
if ( string [i] == ‘_’ )
num++;
else
num = 0;
if ( num == 2 ) {
underScore = false;
atomize;
}}
if ( alpha_string && underScore)
printf (“Solution: %s is a sound identifiern”, string);
else
printf (“Solution: %s will not be any longer a sound identifiern”, string);
getche();
} //code by Afolabi Achiever (techbytebox)

Urged: Total Manual on The style to put in Xampp
I am hoping your C Program compiles with out error?? if that is the case good tumble a observation and we are going to be gay to let you out, else share this page along with your programming chums through 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