#include<stdio.h>
#include<string.h>
int main()
{
int n, a;
char anik[50], rob[50];
printf("Enter First String : ");
gets(anik);
printf("Enter Second String : ");
gets(rob);
printf("Enter Number Which Number is Compare with First String : ");
scanf("%d", &n);
a = strncmp(anik, rob, n);
if(a == 0)
{
printf("\nString are Equal\n");
}
else
{
printf("\nString are not Equal\n");
}
return 0;
}
#include<string.h>
int main()
{
int n, a;
char anik[50], rob[50];
printf("Enter First String : ");
gets(anik);
printf("Enter Second String : ");
gets(rob);
printf("Enter Number Which Number is Compare with First String : ");
scanf("%d", &n);
a = strncmp(anik, rob, n);
if(a == 0)
{
printf("\nString are Equal\n");
}
else
{
printf("\nString are not Equal\n");
}
return 0;
}
Comments
Post a Comment