Program to accept a string and display its alternate characters by kundalokesh

VIEWS: 40 PAGES: 1

									#include<stdio.h>
#include<conio.h>
#include<string.h>
char alt(char *p);
void main()
{
char str[10];
clrscr();
printf("\n\nEnter the string\t");
gets(str);
alt(str);
getch();
}
char alt(char *p)
{
int j,l;
l=strlen(p);
printf("\n\nAlternate characters of the entered string are\t");
for(j=0;j<=l-1;j=j+2)
{
printf("%c",p[j]);
}
return 1;
}

								
To top