Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write the function. if all the character in string B appear in
string A, return true, otherwise return false.

Answer Posted / raghuram.a

#include<iostream.h>
#include<string.h>
int h(char letter)
{

return(letter-97);
}

int main()

{

char str1[100],str2[100];

int i=0,count[26];
for(i=0;i<26;i++)

count[i]=0;

clrscr();
cout<<"\n\nenter 1st string:";

cin>>str1;

cout<<"\n\nenter 2nd string:";

cin>>str2;
for(i=0;i<strlen(str1);i++)

{

count[h(str1[i])]++;

}
for(i=0;i<strlen(str2);i++)

{

count[h(str2[i])]--;
} int flag=0;

for(i=0;i<26;i++)

{if(count[i]!=0)
{cout<<"\n\nnot anagrams";

flag=1;

break;

}
}

if(flag==0)

cout<<"\n\nanagrams";

return 0;

}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to palindrom string in c language?

10817


create a C-code that will display the total fare of a passenger of a taxi if the driver press enter,the timer will stop. Every 10 counts is 2 pesos. Initial value is 25.00

6919


write a c program to input initial & final time in the format hh:mm and find the time intervel between them? Ex inputs are initial 06:30 final 00:05 and 23:22 final 22.30

2643


Develop a routine to reflect an object about an arbitrarily selected plane

3553


Can you send Code for Run Length Encoding Of BMP Image in C Language in linux(i.e Compression and Decompression) ?

4341


write a program for area of circumference of shapes

2507


What is full form of PEPSI

2364


Write a routine to implement the polymarker function

4837


why do you use macros? Explain a situation where you had to incorporate macros in your proc report? use a simple instream data example with code ?

2720


Hi, i have a project that the teacher want a pyramid of numbers in C# or java...when we click a button...the pyramid should be generated in a listbox/or JtextArea...and the pyramid should have the folowing form: 1 232 34543 4567654 567898765 67890109876 7890123210987 890123454321098 90123456765432109 0123456789876543210 Plz help with codes...didn't find anything on the net.

3168


Cluster head selection in Wireless Sensor Network using C programming language.

3675


How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?

2492


how to create a 3x3 two dimensional array that will give you the sums on the left and bottom columns

3598


Given a spherical surface, write bump-mapping procedure to generate the bumpy surface of an orange

3301


What is the match merge ? compare data step match merge with proc sql merge - how many types are there ? data step vs proc sql

2862