Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
#include <stdio.h>
#include <conio.h>char* ReturnSmallerChar(char* s1, char* s2);
void main()
{
char str1[5], str2[5];
int i;
clrscr();printf("Enter str1: ");
gets(str1);
printf("Enter str2: ");
gets(str2);
char* str= ReturnSmallerChar(str1,str2);
printf(" The Smaller Character is: ");
for (i=0; i<5; i++)
printf("%c", str);
}char* ReturnSmallerChar(char* s1, char* s2)
{
char* temp;
int a=0;if (s1[a]>s2[a])
temp[a]=s2[a];
else
temp[a]=s1[a];a++;
if(a<5)
return(ReturnSmallerChar(s1,s2));
else
return temp;
}

Tell us what errors you're getting so we don't have to look through all your code and take guesses.
-SN

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |