• Follow Us

Panagram in c

Let’s have a look at the program of Panagram in C programming Language.

A Panagram is a sentence containing every letter of the alphabet like “The quick brown fox jumps over the lazy dog” . This sentence consists of all the alphabet.

C program to check if a given string is panagarm or not.

#include<stdio.h>
#include<conio.h>
#include<string.h>

int main()
{
int x[26]={0},i,n;<br / char c[100];
clrscr();
gets(c);
n=strlen(c);
for(i=0;i<n;i++)
{
if(c[i]>=65&&c[i]<=90)
x[c[i]-26]++;
else if(c[i]>=97&&c[i]<=122)
x[c[i]-97]++;
}
for(i=0;i<26;i++)
{
if(x[i]==0)
{
break;
}
}
if(i==26)
{
printf(“panagram”);
}
else
{
printf(“not panagram”);
}
return 0;
}

Leave a Reply

Your email address will not be published. Required fields are marked *

Shopping cart