CP 2 Back
CP 2 Back
rev[j]=str[i];
j++;
https://www.keralanotes.com/
i--;
}
rev[j]='\0';
printf("\nReverse=%s",rev);
}
Output
Enter the string: hello
Reverse=olleh
{ {
char a [25];
co
char str[20];
int len,i,j,flag; int v=0,c=0,S=0;
printf ("Enter the string :");
printf("Enter the string:");
s.
gets (a);
gets(str);
te
{
{ v=v+1;
ra
if(str[i] != str[len-i-1]) }
{
ke
} }
27
if(flag == 0)
EST102 Programming in C
for loop is similar to while, for statements are often used to process lists such a
{ else
printf("\nPalindrome"); {
} c = c+1;
For More Study Materials : www.keralanotes.com
else }
m
{ }
printf("\nNot Palindrome"); printf("Number of vowels %d\n",v);
co
}
}
// To count the number of digits in the number
t e
IIPE
no
17
rev = sum + pow(temp,count);
OUTPUT
printf("Enter the number:");
Number of vowels 6
n = n/10;
count++;
n=n/10;
Number of consonants 5
Armstrong or not.
#include <math.h>
#include <stdio.h>
range of numbers.
org=n;
void main()
else
Armstrong
OUTPUT
for loop
{
IIPE
{