#include <stdio.h>
int main ()
{
int i,n;
char a[100];
printf("Enter string: ");
gets(a);
printf("Enter character position: ");
scanf("%d",&n);
for(i=0;i<a[i];i++)
{
if((i+1)==n)
{
printf("The value of this character %d",a[i]);
break;
}
}
return 0;
}
No comments:
Post a Comment