0% found this document useful (0 votes)
3 views5 pages

Record

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

Record

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

#include<stdio.

h>

#include<string.h>

void main()

int i,c=o,k=0,i;

char a[20];

print("enter the string ")

gets(a)

l=strlen(a)

for(i=0;i<=l/2,i++)

{ if(a[i]=a[l-i-1])

{ k=1;

break;

if(k==0)

printf(string is pali);

else

printf(it is not a palindrome);

exp12

read a string ending with a dollar symbol store t an array and count the no of vowels consonants and
spaces in it

exp 13

display the factorial OF THE NUMBER USING FUNCTIOM

exp

#include<stdio.h>

void fact(int);
void main()

int a;

printf("Enter the no whose factorial is to be found");

scanf("%d",&a);

fact(a);

void fact(int a)

int i,facto=1;

for(i=1;i<=a;i++)

facto=facto*i;

printf("Factorial of the number is%d",facto);

//output

Enter the no whose factorial is to be found5

Factorial of the number is120

#include<stdio.h>

#include<string.h>

void main()

char a[10],b[10];
int i,l=0,count;

printf("Enter the string ");

gets(a);

for(i=0;a[i]!='\0';i++)

l=l+1;

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

b[l-1-i]=a[i];

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

if( a[i]==b[i])

count=count+1;

printf("%d",count);

if (count==l)

printf("It is a palindrome");

else
printf("not a palindrome");

//output

Enter the stringmalayalam

9It is a palindrome

#include<stdio.h>

#include<string.h>

void main()

char a[20];

int i,b=0,c=0,d=0;

printf("Enter the string");

gets(a);

for(i=0;a[i]!='\0';i++)

if(a[i]=='a'||a[i]=='e'||a[i]=='i'||a[i]=='o'||a[i]=='u'||a[i]=='A'||a[i]=='E'||a[i]=='I'||a[i]=='O'||
a[i]=='U')

b++;

else if(a[i]>'a'&&a[i]<='z'||a[i]<='A'&&a[i]>='Z')

c++;

else if(a[i]==" ")

d++;

}
printf("vowels%d",b);

printf("\n");

printf("consonants%d",c);

printf("\n");

printf("spaces%d",d);

//output

Enter the stringkarthick$

vowels2

consonants6

spaces0

You might also like