Question: Hi there, i am converting the following code using conditional operators: ORIGINAL CODE int main() { char character; printf(Enter any character: %c); scanf(%c, &character); if

Hi there,

i am converting the following code using conditional operators:

ORIGINAL CODE

int main()

{

char character;

printf("Enter any character: %c");

scanf("%c", &character);

if (character >64 && character

printf(" Character '%c' is an upper case", character);

else if (character >96 && character

printf(" Character '%c' is a lower case", character);

else if (character >47 && character

printf(" Character '%c' is a digit", character);

else if (character >=0 && character =58 && character =91 && character =123 && character

printf(" Character '%c' is a special symbol", character);

}

NEW CODE:

int main ()

{

char character;

scanf("%c", &character);

character > 64 && character

: (character >96 && character

(character >47 && character

(character >=0 && character =58 && character =91 && character =123 && character

printf(" Character '%c' is a special symbol", character)));

}

this code shows an error squiggle in the colon at the very end of it:

Hi there, i am converting the following code using conditional operators: ORIGINALI have tried many times to find the error in it but so far, I haven't figured it out.

Could you please explain whether I am typing an extra parenthesis or what is the error in my syntax?

Thank you,

int main() { char character; scanf("%c", &character); character > 64 && character 96 && character 47 && character =0 && character =58 && character =91 && character =123 && character

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!