Saturday, June 13, 2020

four alphabets alphabetical order in c

The program must accept four alphabets as the input. If the four alphabets are in alphabetical order print YES as the output. Else print NO as the output.

Example Input/Output 1:
Input:
a c e r

Output:
YES


solution:

int main()
{
char a,b,c,d;
scanf("%c %c %c %c",&a,&b,&c,&d);
if(a<b&&b<c&&c<d){
    printf("yes");
}
else{
    printf("no");
}
}

No comments:

Post a Comment

MFIB Comma Separated Integers

Fill in the blanks with code so that the program must accept three integers separated by a space and print them separated by a comma as the ...