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
What is the difference between text files and binary files?
What is a null string in c?
In C language what is a 'dangling pointer'?
write a program to display all prime numbers
Explain what are multidimensional arrays?
largest Of three Number using without if condition?
What is methods in c?
Want to know how to write a C program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.
Give differences between - new and malloc() , delete and free() ?
A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers
For what purpose null pointer used?
what is the structure pointer?
How can I remove the leading spaces from a string?
What is the difference between declaring a variable by constant keyword and #define ing that variable?
hw can we delete an internal node of binary search tree the internal node has child node..plz write progarm