اكتب برنامج يقوم بالمقارنة بين نصين و ايجاد الفرق بينهما
-
2022-04-23
- | esmailrabie902139106278
- | م348
اكتب برنامج يقوم بالمقارنة بين نصين و ايجاد الفرق بينهما
الأجوبة
ابحث عن مسائل برمجة سي بلس بلس | C++ programming بالانجليزي
#include<iostream.h>
#include<coni.h>
#include<stdio.h>
#include<string.h>
#include<process.h>
void main()
{
clrscr();
char s1[100],s2[100];
int f;
cout<<"Enter the first string =";
gets(s1);
cout<<"Enter the second string =";
gets(s2);
f=strcom(s1,s2);
cout<<f;
}
int stream(s1,s2);
}
int i;
int m=0;
int n=0;
for(i=0;i<strlen(str1);i++)
{
n=((str1[i]-str2[i]));
if(n<0)
{
cout<<"string one first"<<endl;
return(-1);
exit(0);
}
else if (n > 0)
{
cout<<"string two first"<<endl;
return(1);
exit(0);
}
}
}
output:
Enter the first string = this is a string
Enter the second string = this is a string
Both string are equel
0_
-
2022-04-23
- | esmailrabie902139106278
- | إبلاغ عن إساءة
أسئلة مشابهة