#include<stdio.h>
#include<conio.h>
int main()
{
char str[20],charsrc;
int i,j=0,re;
printf("Enter the string\n");
gets(str);
printf("Enter the character to be searched : ");
charsrc=getche();
for(i=0;i<20;i++)
{
if(charsrc==str[i])
{
re=i;
j=1;
}
}
if(j==1)
printf("Character is at position %d",re);
else
printf("Not found.");
return 0;
}
Copyright © 2026 eLLeNow.com All Rights Reserved.