Enter·the·first·character:·C
Enter·the·second·character:·c
Enter·the·third·character:·C
Not·Equal
#include <stdio.h>
int main(void) {
char character1,character2,character3;
printf("Enter the first character: ");
character1 = getchar();
printf("Enter the second character: ");
character2 = getchar();
character2 = getchar();
printf("Enter the third character: ");
character3 = getchar();
character3 = getchar();
if(character1==character2 && character1==character3)
{
printf("Equal\n");
}else{
printf("Not Equal\n");
}
getchar();
getchar();
return 0;
}
Comments
Leave a comment