#include <stdio.h>
#include<string.h>
int main()
{
char* country = "Bangladesh";
char* country2;
printf("Enter country: ");
country2 = malloc(256);
scanf("%255s", country2); // Don't read more than 255 characters
if (strcmp(country, country2) == 0)
{
printf("True\n");
}
else
{
printf("False\n");
}
return 0;
}
#include<string.h>
int main()
{
char* country = "Bangladesh";
char* country2;
printf("Enter country: ");
country2 = malloc(256);
scanf("%255s", country2); // Don't read more than 255 characters
if (strcmp(country, country2) == 0)
{
printf("True\n");
}
else
{
printf("False\n");
}
return 0;
}
No comments:
Post a Comment