Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Finding first/last occurrence of a character in a string
without using strchr( ) /strrchr( ) function.

Answer Posted / sepideh

#include<iostream>
#include<conio.h>
using namespace std;
int main(){
char m[20];
char x;
gets(m);
x=getch();
for(int i=0;i!=null;i++)
if(m[i]==x){
cout<<i;}
getch();}

Is This Answer Correct ?    9 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is masking?

1213


What is the -> in c?

1062


Explain how to reverse singly link list.

1202


What is 'bus error'?

1208


Do pointers need to be initialized?

1161


What are formal parameters?

1174


Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

1153


List the difference between a While & Do While loops?

1150


What is c standard library?

1270


Differentiate between the = symbol and == symbol?

1361


Which built-in library function can be used to match a patter from the string?

1347


What is void pointers in c?

1066


Why do we use static in c?

1177


Can the sizeof operator be used to tell the size of an array passed to a function?

1174


What is wild pointer in c with example?

1109