Choose Category
#include<stdio.h> #include<conio.h> void main() { char x[30]; char c; int i; clrscr(); printf("enter the string:"); scanf("%s",x); printf("enter the char to which its position is to be found:"); scanf(" %c",&c); for(i=0;x[i]!=NULL;i++) { if(x[i]==c) { printf("the position is:%d",i); } } getch(); }