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
explain what are actual arguments?
What is wrong with this statement? Myname = 'robin';
What is the difference between far and near ?
How can you access memory located at a certain address?
Explain how are portions of a program disabled in demo versions?
write a sorting prgm to sort 50 nos and sum them and also remove all the occurrences of 15 and print it?
What is the use of a semicolon (;) at the end of every program statement?
Explain the properties of union.
What is array within structure?
Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..
If i have an array 0 to 99 i.e,(Size 100) I place the values 1 to 100 randomly like a[0]=29,a[1]=56 upto array[99].. the values are only between 1 to 100. getting the array values by using scanf.. If i entered one wrong element value line a[56]=108. how can i find it.. and also how to find the missing value in 1 to 100.. and i want to replace the missing values.. any one of them know please post your answer..
What do you mean by a local block?
Why is c fast?
Why main is used in c?
Is there any demerits of using pointer?