0% found this document useful (0 votes)
94 views1 page

Anagram

The C program takes two strings as input from the user, compares the characters of the strings, and determines if the strings are anagrams of each other. It uses pointers to iterate through each string character by character, checking for a match. If it reaches the null character of one string without finding a match, it prints that the strings are not anagrams, otherwise it prints that they are anagrams.

Uploaded by

APGHOSH
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
94 views1 page

Anagram

The C program takes two strings as input from the user, compares the characters of the strings, and determines if the strings are anagrams of each other. It uses pointers to iterate through each string character by character, checking for a match. If it reaches the null character of one string without finding a match, it prints that the strings are not anagrams, otherwise it prints that they are anagrams.

Uploaded by

APGHOSH
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

#include<stdio.

h>
#include<conio.h>
#include<string.h>
void main()
{
char str1[10],str2[10];
char *s1,*s2;
clrscr();
printf ("\nENTER ANY STRING...");
gets(str1);
printf ("\nENTER THE STRING YOU WANT TO CHECK...");
gets(str2);
s1 = str1;
while(*s1)
{
s2 = str2;
while (*s2)
{
if (*s1 == *s2)
{
break;
}
s2++;
}
if (*s2 == '\0')
{
printf ("\nSTRING IS NOT ANAGRAM..");
getch();
exit(0);
}
s1++;
}
printf ("\nSTRING IS ANAGRAM..");
getch();
}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy