Find position of given character in string in C Programming Tamil


#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
     int i,n=0;
     char *a,s;
     clrscr();
     printf("\nenter the string ");
     gets(a);
     printf("\nEnter the character :");
     scanf("%c",&s);
     for(i=0;i<strlen(a);i++)
     {
	  if(s==a[i])
	  {
	     n++:
	  }
     }
     printf("\n Position  :%d",n);
     getch();
}

Login To Download Source Code

Leave a Comment:

Login To Comment

List Of Programs


Goto Examples

Operators

Looping

Number Conversion

Pattern Design

Arrays

Matrix Examples

Sorting Examples

String Function

Change Case

String In C

Maths Functions

User Defined Functions

Recursive Functions

Pointer

Structure

File Concept

Calender Programming