#include<iostream.h>
#include<conio.h>
#include<string.h>
int main()
{
clrscr();
char string1[20],string2[15];
int i,j;
string1="AMITABH BACHCHAN";
string2="RAJNIKANTH";
int n1=strlen(string1);
int n2=strlen(string2);
cout<<"common alphabets in AMITABH BACHCHAN AND RAJNIKANTH are-";
for(i=0;i<n1;i++)
{
for(j=0;j<n2;j++)
{
if(string1[i]==string2[j])
cout<<string[i];
}
}
}
madhusudan.srinivasan 0 Newbie Poster
Bob 15 using namespace Bob Team Colleague
madhusudan.srinivasan 0 Newbie Poster
Bob 15 using namespace Bob Team Colleague
iamthwee
rajat.sethi93 -3 Newbie Poster
WaltP commented: Bad suggestion. -3
rajat.sethi93 -3 Newbie Poster
WaltP commented: Even worse suggestion. +0
rajat.sethi93 -3 Newbie Poster
rajat.sethi93 -3 Newbie Poster
ravenous 266 Posting Pro in Training
np complete 8 Newbie Poster
np complete 8 Newbie Poster
WaltP commented: gets() does not have *undefined* behaviour. It has *dangerous* behavior. +14
rajat.sethi93 -3 Newbie Poster
np complete 8 Newbie Poster
vijayan121 1,152 Posting Virtuoso
ravenous 266 Posting Pro in Training
Tarick careem 0 Newbie Poster
vijayan121 1,152 Posting Virtuoso
WaltP commented: He can't even define a char string! How the h*** is he going to use vectors, maps, numeric_limits, sorts, and all that crap? Help him, don't flaunt your expertise +0
m4ster_r0shi commented: I don't think vectors, maps, numeric_limits and sorts are crap. +6
vijayan121 1,152 Posting Virtuoso
ravenous 266 Posting Pro in Training
vijayan121 1,152 Posting Virtuoso
ravenous 266 Posting Pro in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.