Pangram Checker
Pangram-is a word or Phrase which have all the Alphabets from a to z in it.
"Nice One Program"
#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<ctype.h>
void main()
{ clrscr();
char s[100]; int l,i=0,j,f=0;
cout<<"Enter The String For Checking:\n\n";
cin.getline(s,100);
l=strlen(s);
int t;
cout<<l<<endl;
while(s[i])
{
s[i]=tolower(s[i]);
i++;
}
cout<<s;
for(i=97;i<122;i++)
{ for(j=0;j<l;j++)
{ t=s[j];
if(s[j]=='\0')
f=0;
else if(t==i)
f=1;
}
if(f==0)
break;
}
if(f==1)
cout<<"\n\nPANGRAM";
else
cout<<"\n\nNOT PANGRAM";
getch();
}
Pangram-is a word or Phrase which have all the Alphabets from a to z in it.
"Nice One Program"
#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<ctype.h>
void main()
{ clrscr();
char s[100]; int l,i=0,j,f=0;
cout<<"Enter The String For Checking:\n\n";
cin.getline(s,100);
l=strlen(s);
int t;
cout<<l<<endl;
while(s[i])
{
s[i]=tolower(s[i]);
i++;
}
cout<<s;
for(i=97;i<122;i++)
{ for(j=0;j<l;j++)
{ t=s[j];
if(s[j]=='\0')
f=0;
else if(t==i)
f=1;
}
if(f==0)
break;
}
if(f==1)
cout<<"\n\nPANGRAM";
else
cout<<"\n\nNOT PANGRAM";
getch();
}
No comments:
Post a Comment