Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save aurelianopinheiro/a73b0f501df41cb2d01d7b72249959d5 to your computer and use it in GitHub Desktop.
Save aurelianopinheiro/a73b0f501df41cb2d01d7b72249959d5 to your computer and use it in GitHub Desktop.
int main(void)
{
char name1[256] ;
char name2[256] ;
int n = 0;
int p ;
int z ;
printf("1st name:");
scanf("%s", name1);
printf("2nd name:");
scanf("%s", name2);
for(p=0; name1[p] != '\0';++p);
{
}
for(z=0; name2[z] != '\0';++z);
{
}
while(n == 0){
if(name1[p] > name2[z] && name2 != '\0' && name1 != '\0')
{
printf("The Name %s its bigger than the name %s",name1,name2);
n = n+1;
}
if(name1[p] < name2[z] && name2 != '\0' && name1 != '\0')
{
printf("The Name %s ots bigger than the name %s",name2,name1);
n = n+1;
}
else
{
printf("Names are the same");
n = n + 1;
}
}
return (0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment