C program to input any string and determine Whether the whole string contain double character or not.

C program to input any string and determine Whether the whole string contain double character or not.

#include<stdio.h>
#include<conio.h>
void main( )
{
char str[20]; int i, j;
clrscr( );
printf("enter any string ");
scanf("%s",str);
i=0;
while(str[i]!='\0')
{
j=0;
while(j {
if(str[i]==str[j])
{
printf("Double character %c\n", str[i]);
}
j=j+1;
}
i=i+1;
}
getch( );
}

Post a Comment

0 Comments