Commit 9d88b816 by chazog

Upload New File

parent 8d85b1b4
Showing with 37 additions and 0 deletions
#include <stdio.h>
#include <string.h>
#include <ctype.h>
int main()
{
int i, j, a;
char name[10][40]; // name string
printf("please enter ten names:\n");
for (i = 0; i < 10; i++)
{
scanf("%s", name[i]);
for (j = 0; j < 40; j++)
{
name[i][j] = tolower(name[i][j]);
}
}
for (i = 0; i < 10; i++)
{
for (j = i + 1; j < 10; j++)
{
a = strcmp(name[i], name[j]);
if (a == 0)
{
printf("Duplicate detected");
return 0;
}
}
}
printf("No duplicate");
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment